X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fview%2Fflag.hpp;h=af4c7b9d15012ee89e691dfee9eeea13c1c20c90;hb=48257a69ffad409c9893605d99cd6e15161dff4f;hp=659d5cc1c55143aaa88bf45113f980f9a2483cf9;hpb=8914fe790fb677c56194a3ae4da06ba671fca78a;p=pulseview.git diff --git a/pv/view/flag.hpp b/pv/view/flag.hpp index 659d5cc1..af4c7b9d 100644 --- a/pv/view/flag.hpp +++ b/pv/view/flag.hpp @@ -18,15 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_VIEW_FLAG_H -#define PULSEVIEW_PV_VIEW_FLAG_H +#ifndef PULSEVIEW_PV_VIEW_FLAG_HPP +#define PULSEVIEW_PV_VIEW_FLAG_HPP + +#include #include "timemarker.hpp" +class QMenu; + namespace pv { namespace view { -class Flag : public TimeMarker +class Flag : public TimeMarker, + public std::enable_shared_from_this { Q_OBJECT @@ -40,7 +45,7 @@ public: * @param time The time to set the flag to. * @param text The text of the marker. */ - Flag(View &view, double time, const QString &text); + Flag(View &view, const pv::util::Timestamp& time, const QString &text); /** * Copy constructor. @@ -59,7 +64,15 @@ public: pv::widgets::Popup* create_popup(QWidget *parent); + QMenu* create_context_menu(QWidget *parent); + + void delete_pressed(); + + void drag_by(const QPoint &delta); + private Q_SLOTS: + void on_delete(); + void on_text_changed(const QString &text); private: @@ -69,4 +82,4 @@ private: } // namespace view } // namespace pv -#endif // PULSEVIEW_PV_VIEW_FLAG_H +#endif // PULSEVIEW_PV_VIEW_FLAG_HPP