systemtime.cpp
40 lines
| 1.1 KiB
| text/x-c
|
CppLexer
/ paulcommon / systemtime.cpp
r50 | #include "systemtime.h" | |||
SystemTime::SystemTime(QWidget *parent) : | ||||
QWidget(parent) | ||||
{ | ||||
main_LAYOUT = new QGridLayout; | ||||
arbitraryTime = new ArbitraryTime(1); | ||||
currentTimePrefix_LABEL = new QLabel(tr("Current System Time: 0x")); | ||||
currentTime_LABEL = new QLabel(tr("-")); | ||||
currentTimePrefix_LABEL->setAlignment(Qt::AlignRight); | ||||
currentTime = 0x80000000; | ||||
currentTime_LABEL->setText(QString::number(currentTime, 16)); | ||||
main_LAYOUT->addWidget(currentTimePrefix_LABEL, 0, 0, 1, 1); | ||||
main_LAYOUT->addWidget(currentTime_LABEL, 0, 1, 1, 1); | ||||
main_LAYOUT->addWidget(arbitraryTime, 1, 0, 1, 2); | ||||
main_LAYOUT->setColumnStretch(2, 1); | ||||
main_LAYOUT->setRowStretch(2, 1); | ||||
this->setLayout(main_LAYOUT); | ||||
connect(this->arbitraryTime, SIGNAL(timeToSendChanged(long)), | ||||
this, SLOT(editingFinishedSLOT(long))); | ||||
} | ||||
void SystemTime::editingFinishedSLOT(long time) | ||||
{ | ||||
emit ( | ||||
timeToSendChanged(time) | ||||
); | ||||
} | ||||
void SystemTime::systemTimeHasChanged(long time) | ||||
{ | ||||
currentTime = time; | ||||
currentTime_LABEL->setText(QString::number(currentTime, 16)); | ||||
} | ||||