##// END OF EJS Templates
Uses DateUtils
Uses DateUtils

File last commit:

r488:5b65a4cc471b
r488:5b65a4cc471b
Show More
TimeWidget.cpp
47 lines | 1.5 KiB | text/x-c | CppLexer
Add the TimeWidget
r134 #include "TimeWidget/TimeWidget.h"
#include "ui_TimeWidget.h"
Add apply button and its connection for timewidget
r302 #include <SqpApplication.h>
#include <Time/TimeController.h>
add TimeWidget connection
r192
Add the TimeWidget
r134 TimeWidget::TimeWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::TimeWidget}
{
ui->setupUi(this);
add TimeWidget connection
r192
Add apply button and its connection for timewidget
r302 ui->applyToolButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_DialogApplyButton));
add TimeWidget connection
r192 // Connection
connect(ui->startDateTimeEdit, &QDateTimeEdit::dateTimeChanged, this,
&TimeWidget::onTimeUpdateRequested);
connect(ui->endDateTimeEdit, &QDateTimeEdit::dateTimeChanged, this,
&TimeWidget::onTimeUpdateRequested);
Add apply button and its connection for timewidget
r302
connect(ui->applyToolButton, &QToolButton::clicked, &sqpApp->timeController(),
&TimeController::onTimeNotify);
Temporal parameters of the selected variables can be updated using the...
r304
// Initialisation
ui->startDateTimeEdit->setDateTime(
QDateTime::currentDateTime().addSecs(-3600)); // one hour berefore
ui->endDateTimeEdit->setDateTime(QDateTime::currentDateTime());
auto dateTime
= SqpDateTime{QDateTime::currentDateTime().addSecs(-3600).toMSecsSinceEpoch() / 1000.0,
QDateTime::currentDateTime().toMSecsSinceEpoch() / 1000.0};
sqpApp->timeController().onTimeToUpdate(dateTime);
Add the TimeWidget
r134 }
Add apply button and its connection for timewidget
r302
Add the TimeWidget
r134 TimeWidget::~TimeWidget()
{
delete ui;
}
add TimeWidget connection
r192
void TimeWidget::onTimeUpdateRequested()
{
Alexandre Leroux
Uses DateUtils
r488 auto dateTime = SqpDateTime{DateUtils::secondsSinceEpoch(ui->startDateTimeEdit->dateTime()),
DateUtils::secondsSinceEpoch(ui->endDateTimeEdit->dateTime())};
add TimeWidget connection
r192
emit timeUpdated(std::move(dateTime));
}