36 #include <QHBoxLayout>
46 mTimer =
new QTimer(
this);
47 connect(mTimer, SIGNAL(timeout()),
this, SLOT(timeoutSlot()));
48 mTimer->setInterval(1000);
50 QHBoxLayout* layout =
new QHBoxLayout(
this);
54 layout->addWidget(mLabel);
64 if (mTimer->isActive())
66 mStartTime = QDateTime::currentDateTime();
74 this->printText(
"green");
77 void DisplayTimerWidget::timeoutSlot()
79 this->printText(
"black");
82 void DisplayTimerWidget::printText(QString color)
85 mLabel->setText(QString(
"<font size=%1 color=%2><b>%3 s</b></font>").arg(mFontSize).arg(color).arg(secs));
90 return mStartTime.secsTo(QDateTime::currentDateTime());