5 #include <QDateTimeEdit>
11 #include <QVBoxLayout>
23 client::query::SnapshotSelector
34 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);
81 QOverload<int>::of(&QSpinBox::valueChanged),
90 const Time time = latest->isChecked()
112 toDateTime =
new QDateTimeEdit(now.addSecs(60));
116 toEnd =
new QCheckBox(
"End");
117 toEnd->setChecked(
true);
119 QGridLayout* layout =
new QGridLayout(
this);
127 layout->addWidget(
toLabel, row, 0);
129 layout->addWidget(
toEnd, row, 2);
133 connect(
toEnd, &QCheckBox::toggled,
toDateTime, &QDateTimeEdit::setDisabled);
151 if (!
toEnd->isChecked())
171 lastEnd =
new QCheckBox(
"End");
177 for (QSpinBox* sb : sbs)
179 sb->setMinimum(-1000);
180 sb->setMaximum(1000);
186 "Python index semantics: Negative indices count from the end (-1 is the last entry).";
191 QGridLayout* layout =
new QGridLayout(
this);
201 layout->addWidget(
lastEnd, row, 2);
209 QOverload<int>::of(&QSpinBox::valueChanged),
214 QOverload<int>::of(&QSpinBox::valueChanged),
222 long first = 0, last = -1;