5 #include <QDateTimeEdit>
10 #include <QVBoxLayout>
33 dt->setDisplayFormat(
"yyyy-MM-dd HH:mm:ss");
51 label =
new QLabel(
"Timestamp:");
53 dateTime =
new QDateTimeEdit(now);
54 dateTime->setDisabled(
true);
58 microseconds->setDisabled(
true);
59 microseconds->setMinimum(0);
60 microseconds->setMaximum(1000 * 1000 - 1);
61 microseconds->setSingleStep(1);
62 microseconds->setValue(
static_cast<int>(now.toMSecsSinceEpoch() % 1000) * 1000);
64 QHBoxLayout* timestampLayout =
new QHBoxLayout();
65 timestampLayout->addWidget(dateTime);
66 timestampLayout->addWidget(microseconds);
68 latest =
new QCheckBox(
"Latest");
69 latest->setChecked(
true);
71 QGridLayout* layout =
new QGridLayout(
this);
72 layout->addWidget(label, 0, 0);
73 layout->addLayout(timestampLayout, 0, 1);
74 layout->addWidget(latest, 0, 2);
76 connect(latest, &QCheckBox::toggled, dateTime, &QDateTimeEdit::setDisabled);
77 connect(latest, &QCheckBox::toggled, microseconds, &QSpinBox::setDisabled);
87 const Time time = latest->isChecked()
110 toDateTime =
new QDateTimeEdit(now.addSecs(60));
114 toEnd =
new QCheckBox(
"End");
115 toEnd->setChecked(
true);
117 QGridLayout* layout =
new QGridLayout(
this);
125 layout->addWidget(
toLabel, row, 0);
127 layout->addWidget(
toEnd, row, 2);
131 connect(
toEnd, &QCheckBox::toggled,
toDateTime, &QDateTimeEdit::setDisabled);
148 if (!
toEnd->isChecked())
169 lastEnd =
new QCheckBox(
"End");
175 for (QSpinBox* sb : sbs)
177 sb->setMinimum(-1000);
178 sb->setMaximum(1000);
183 QString tooltip =
"Python index semantics: Negative indices count from the end (-1 is the last entry).";
188 QGridLayout* layout =
new QGridLayout(
this);
198 layout->addWidget(
lastEnd, row, 2);
212 long first = 0, last = -1;