]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/timemarker.hpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / views / trace / timemarker.hpp
index 327a498ffe964295d876eb6ea40d38ddb50557f4..f67a0f17a1e36567bb050afa23d6ecedaccdbb2c 100644 (file)
@@ -17,8 +17,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#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 <QColor>
 #include <QDoubleSpinBox>
@@ -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