##// END OF EJS Templates
Unplot menu (1)...
Unplot menu (1) Renames m_MenuBuilder to m_PlotMenuBuilder (a new builder will be added for the Unplot menu)

File last commit:

r281:08349e12a7ef
r297:55e8cf41b3b4
Show More
TimeWidget.cpp
48 lines | 1.5 KiB | text/x-c | CppLexer
Add the TimeWidget
r126 #include "TimeWidget/TimeWidget.h"
#include "ui_TimeWidget.h"
Add apply button and its connection for timewidget
r279 #include <SqpApplication.h>
#include <Time/TimeController.h>
add TimeWidget connection
r178
Add the TimeWidget
r126 TimeWidget::TimeWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::TimeWidget}
{
ui->setupUi(this);
add TimeWidget connection
r178
Add apply button and its connection for timewidget
r279 ui->applyToolButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_DialogApplyButton));
add TimeWidget connection
r178 // 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
r279
connect(ui->applyToolButton, &QToolButton::clicked, &sqpApp->timeController(),
&TimeController::onTimeNotify);
Temporal parameters of the selected variables can be updated using the...
r281
// 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
r126 }
Add apply button and its connection for timewidget
r279
Add the TimeWidget
r126 TimeWidget::~TimeWidget()
{
delete ui;
}
add TimeWidget connection
r178
void TimeWidget::onTimeUpdateRequested()
{
auto dateTime = SqpDateTime{
static_cast<double>(ui->startDateTimeEdit->dateTime().toMSecsSinceEpoch() / 1000.),
static_cast<double>(ui->endDateTimeEdit->dateTime().toMSecsSinceEpoch()) / 1000.};
emit timeUpdated(std::move(dateTime));
}