##// END OF EJS Templates
Creates dialog to rename a variable
Creates dialog to rename a variable

File last commit:

r471:d00d6fd96c10
r634:db1f763a3aa8
Show More
TimeWidget.cpp
50 lines | 1.5 KiB | text/x-c | CppLexer
Add the TimeWidget
r126 #include "TimeWidget/TimeWidget.h"
#include "ui_TimeWidget.h"
Alexandre Leroux
Passes TimeWidget in UTC...
r451 #include <Common/DateUtils.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
Alexandre Leroux
Passes TimeWidget in UTC...
r451 auto endDateTime = QDateTime::currentDateTimeUtc();
auto startDateTime = endDateTime.addSecs(-3600); // one hour before
ui->startDateTimeEdit->setDateTime(startDateTime);
ui->endDateTimeEdit->setDateTime(endDateTime);
Change SqpRange for SqpDateTime
r471 auto dateTime = SqpRange{DateUtils::secondsSinceEpoch(startDateTime),
DateUtils::secondsSinceEpoch(endDateTime)};
Temporal parameters of the selected variables can be updated using the...
r281
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()
{
Change SqpRange for SqpDateTime
r471 auto dateTime = SqpRange{DateUtils::secondsSinceEpoch(ui->startDateTimeEdit->dateTime()),
DateUtils::secondsSinceEpoch(ui->endDateTimeEdit->dateTime())};
add TimeWidget connection
r178
emit timeUpdated(std::move(dateTime));
}