15 #include <QHBoxLayout> 25 mTimer =
new QTimer(
this);
26 connect(mTimer, SIGNAL(timeout()),
this, SLOT(timeoutSlot()));
27 mTimer->setInterval(1000);
29 QHBoxLayout* layout =
new QHBoxLayout(
this);
33 layout->addWidget(mLabel);
43 if (mTimer->isActive())
45 mStartTime = QDateTime::currentDateTime();
53 this->printText(
"green");
56 void DisplayTimerWidget::timeoutSlot()
58 this->printText(
"black");
61 void DisplayTimerWidget::printText(QString color)
64 mLabel->setText(QString(
"<font size=%1 color=%2><b>%3 s</b></font>").arg(mFontSize).arg(color).arg(secs));
69 return mStartTime.secsTo(QDateTime::currentDateTime());
Namespace for all CustusX production code.