]> sigrok.org Git - pulseview.git/blobdiff - pv/view/selectableitem.h
Moved highlight pen into SelectableItem
[pulseview.git] / pv / view / selectableitem.h
index 4bbd1f6993d6813ed6f7016b5029bdf083b46549..d8545ce6e78c2e412153335f1fe1cad28774ebcd 100644 (file)
 
 #include <list>
 
+#include <QPen>
+
 class QAction;
 
 namespace pv {
 namespace view {
 
-class SelectableItem
+class SelectableItem : public QObject
 {
+       Q_OBJECT
+
+private:
+       static const int HighlightRadius;
+
+public:
+       SelectableItem();
+
+public:
+       /**
+        * Returns true if the signal has been selected by the user.
+        */
+       bool selected() const;
+
+       /**
+        * Selects or deselects the signal.
+        */
+       void select(bool select = true);
+
+protected:
+       static QPen highlight_pen();
+
+private:
+       bool _selected;
 };
 
 } // namespace view