Window xp下的QT5开发,使用了statusBar,通过ui->statusBar->addWidget(time); 和 ui->statusBar->addWidget(mode); 为 statusBar 添加了两个 QLabel 控件。
自己通过定时器想要更新 statusBar 里 time 控件所显示的时间。
但是总是提示 statusBar 没有 time 成员。
请问该如何做才好呢?
定时器是在主窗口的构建函数里定义的:
Qtimer *timer = new Qtimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(time_update));
timer->start(1000);