]> sigrok.org Git - pulseview.git/blobdiff - pv/signal.h
Added a label colour chooser dialog
[pulseview.git] / pv / signal.h
index 951ae3172bc576cd12e76dd9ccf349d937584cd4..2afe9528dfe8cceac605d38c6600977f7381b61c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <QColor>
 #include <QPainter>
 #include <QRect>
 #include <QString>
@@ -52,6 +53,16 @@ public:
         */
        void set_name(QString name);
 
+       /**
+        * Get the colour of the signal.
+        */
+       QColor get_colour() const;
+
+       /**
+        * Set the colour of the signal.
+        */
+       void set_colour(QColor colour);
+
        /**
         * Paints the signal with a QPainter
         * @param p the QPainter to paint into.
@@ -96,11 +107,6 @@ private:
        QRectF get_label_rect(const QRect &rect);
 
 protected:
-       /**
-        * Get the colour of the logic signal
-        */
-       virtual QColor get_colour() const = 0;
-
        /**
         * When painting into the rectangle, calculate the y
         * offset of the zero point.
@@ -109,6 +115,8 @@ protected:
 
 protected:
        QString _name;
+       QColor _colour;
+
        QSizeF _text_size;
 };