X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Ftimemarker.cpp;h=a5d280bdd97a18cf1f276cc9843a1f1f4ea6b463;hb=7c238e082a6fadc14f90285805f5901cc8f68570;hp=40bb81731884c54fec36b1ed18bba5195c0879df;hpb=509727eb807fe8cc8bd6c224099d77cbb2075c18;p=pulseview.git diff --git a/pv/view/timemarker.cpp b/pv/view/timemarker.cpp index 40bb8173..a5d280bd 100644 --- a/pv/view/timemarker.cpp +++ b/pv/view/timemarker.cpp @@ -22,9 +22,10 @@ #include "view.h" +#include #include -using namespace std; +#include namespace pv { namespace view { @@ -69,6 +70,28 @@ void TimeMarker::paint(QPainter &p, const QRect &rect) p.drawLine(QPointF(x, rect.top()), QPointF(x, rect.bottom())); } +pv::widgets::Popup* TimeMarker::create_popup(QWidget *parent) +{ + using pv::widgets::Popup; + + Popup *const popup = new Popup(parent); + QFormLayout *const form = new QFormLayout(popup); + popup->setLayout(form); + + _value_widget = new QDoubleSpinBox(parent); + _value_widget->setDecimals(9); + _value_widget->setSuffix("s"); + _value_widget->setSingleStep(1e-6); + _value_widget->setValue(_time); + + connect(_value_widget, SIGNAL(valueChanged(double)), + this, SLOT(on_value_changed(double))); + + form->addRow(tr("Time"), _value_widget); + + return popup; +} + void TimeMarker::on_value_changed(double value) { if (!_updating_value_widget) {