##// END OF EJS Templates
Adds a close button to a graph widget + calls close() method when clicked...
Adds a close button to a graph widget + calls close() method when clicked The graph's title is replaced at the button level (to have the same behavior as in a zone widget)

File last commit:

r192:274725519804
r266:64be3fdecdc1
Show More
TimeWidget.cpp
29 lines | 789 B | text/x-c | CppLexer
#include "TimeWidget/TimeWidget.h"
#include "ui_TimeWidget.h"
TimeWidget::TimeWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::TimeWidget}
{
ui->setupUi(this);
// Connection
connect(ui->startDateTimeEdit, &QDateTimeEdit::dateTimeChanged, this,
&TimeWidget::onTimeUpdateRequested);
connect(ui->endDateTimeEdit, &QDateTimeEdit::dateTimeChanged, this,
&TimeWidget::onTimeUpdateRequested);
}
TimeWidget::~TimeWidget()
{
delete ui;
}
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));
}