Skip to content
Snippets Groups Projects
Commit c59c6f22 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Tweak display of timestamp input

parent 3d293510
No related branches found
No related tags found
Loading
......@@ -40,11 +40,12 @@ namespace armarx::armem::gui
// This cast is safe because 999 * 1000 < MAX_INT.
microseconds->setValue(
static_cast<int>((QDateTime::currentMSecsSinceEpoch() % 1000) * 1000));
microseconds->setSuffix(" µs");
auto* hlayout = new QHBoxLayout();
hlayout->addWidget(new QLabel("Time"));
hlayout->addWidget(dateTime);
hlayout->addWidget(new QLabel("µs"));
hlayout->addWidget(new QLabel("."));
hlayout->addWidget(microseconds);
setLayout(hlayout);
}
......@@ -58,8 +59,10 @@ namespace armarx::armem::gui
RelativeTimestampInput::RelativeTimestampInput() : seconds(new QDoubleSpinBox())
{
seconds->setSingleStep(0.1);
seconds->setDecimals(6);
seconds->setSingleStep(0.1);
seconds->setRange(-1e6, 1e6);
seconds->setSuffix(" s");
seconds->setValue(0);
auto* hlayout = new QHBoxLayout();
......
......@@ -35,6 +35,7 @@ namespace armarx::gui
namespace armarx::armem::gui
{
class TimestampInput : public QWidget
{
Q_OBJECT // NOLINT
......@@ -43,6 +44,7 @@ namespace armarx::armem::gui
virtual armarx::DateTime retrieveTimeStamp() = 0;
};
class AbsoluteTimestampInput : public TimestampInput
{
Q_OBJECT // NOLINT
......@@ -57,6 +59,7 @@ namespace armarx::armem::gui
armarx::gui::LeadingZeroSpinBox* microseconds;
};
class RelativeTimestampInput : public TimestampInput
{
Q_OBJECT // NOLINT
......@@ -69,4 +72,5 @@ namespace armarx::armem::gui
private:
QDoubleSpinBox* seconds; // NOLINT
};
} // namespace armarx::armem::gui
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment