我是用下面的函数来显示时间的,在mainwindow的构造函数中调用:
void MainWindow::showTime(QTimerEvent *event)
{
    QTime time = QTime::currentTime();
    QDate date = QDate::currentDate();
    ui->timeLCD->setNumDigits(8);
    ui->dateLCD->setNumDigits(10);
    QString text1 = time.toString();
    QString text2 = date.toString();
    ui->timeLCD->display(text1);
    ui->dateLCD->display(text2);
}
显示出来的时间是静止的,日期显示也不正确(  19 2010)。
那么,如何显示动态的时间呢?日期显示为什么会不正确呢?
[ 此帖被shiroki在2010-05-19 23:18重新编辑 ]