X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fflag.hpp;h=4c4c977f0d19254bf17b199c6ede54e688a2d60a;hb=f6a93932056dab5e2f75207b65197b436d4141a5;hp=4f707bddf3caaa5d9c9fc233950769510041bf21;hpb=1573bf16ba50d1c023ad3a9ce596f0ab6eaeacff;p=pulseview.git
diff --git a/pv/views/trace/flag.hpp b/pv/views/trace/flag.hpp
index 4f707bdd..4c4c977f 100644
--- a/pv/views/trace/flag.hpp
+++ b/pv/views/trace/flag.hpp
@@ -17,8 +17,8 @@
* along with this program; if not, see .
*/
-#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
-#define PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACE_FLAG_HPP
+#define PULSEVIEW_PV_VIEWS_TRACE_FLAG_HPP
#include
@@ -32,12 +32,16 @@ namespace pv {
namespace views {
namespace trace {
+/**
+ * The Flag class represents items on the @ref Ruler that mark important
+ * events on the timeline to the user. They are editable and thus non-static.
+ */
class Flag : public TimeMarker, public enable_shared_from_this
{
Q_OBJECT
public:
- static const QColor FillColour;
+ static const QColor FillColor;
public:
/**
@@ -56,18 +60,25 @@ public:
/**
* Returns true if the item is visible and enabled.
*/
- bool enabled() const;
+ virtual bool enabled() const override;
/**
* Gets the text to show in the marker.
*/
- QString get_text() const;
+ virtual QString get_text() const override;
+
+ /**
+ * Sets the text to show in the marker.
+ */
+ virtual void set_text(const QString &text) override;
+
+ virtual pv::widgets::Popup* create_popup(QWidget *parent) override;
- pv::widgets::Popup* create_popup(QWidget *parent);
+ virtual QMenu* create_header_context_menu(QWidget *parent) override;
- QMenu* create_context_menu(QWidget *parent);
+ virtual void delete_pressed() override;
- void delete_pressed();
+ QRectF label_rect(const QRectF &rect) const override;
private Q_SLOTS:
void on_delete();
@@ -82,4 +93,4 @@ private:
} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACE_FLAG_HPP