X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Ftimemarker.hpp;h=f67a0f17a1e36567bb050afa23d6ecedaccdbb2c;hb=HEAD;hp=327a498ffe964295d876eb6ea40d38ddb50557f4;hpb=710c2a1896fbac968c82f2d1257aaabd10a48cc8;p=pulseview.git diff --git a/pv/views/trace/timemarker.hpp b/pv/views/trace/timemarker.hpp index 327a498f..f67a0f17 100644 --- a/pv/views/trace/timemarker.hpp +++ b/pv/views/trace/timemarker.hpp @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_MARKER_HPP -#define PULSEVIEW_PV_VIEWS_TRACEVIEW_MARKER_HPP +#ifndef PULSEVIEW_PV_VIEWS_TRACE_TIMEMARKER_HPP +#define PULSEVIEW_PV_VIEWS_TRACE_TIMEMARKER_HPP #include #include @@ -74,8 +74,6 @@ public: float get_x() const override; - virtual const pv::util::Timestamp delta(const pv::util::Timestamp& other) const override; - /** * Gets the arrow-tip point of the time marker. * @param rect the rectangle of the ruler area. @@ -97,10 +95,21 @@ public: QRectF hit_box_rect(const ViewItemPaintParams &pp) const override; /** - * Gets the text to show in the marker. + * Gets the current text to show in the marker - this may be dynamic. + */ + virtual QString get_display_text() const; + + /** + * Gets the default text used to show the marker - e.g. the user-editable + * name. */ virtual QString get_text() const = 0; + /** + * Sets the text to show in the marker. + */ + virtual void set_text(const QString &text); + /** * Paints the marker's label to the ruler. * @param p The painter to draw with. @@ -119,6 +128,8 @@ public: virtual pv::widgets::Popup* create_popup(QWidget *parent) override; private Q_SLOTS: + void on_popup_closed(); + void on_value_changed(const pv::util::Timestamp& value); protected: @@ -136,4 +147,4 @@ protected: } // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_MARKER_HPP +#endif // PULSEVIEW_PV_VIEWS_TRACE_TIMEMARKER_HPP