]> sigrok.org Git - pulseview.git/commitdiff
ViewItem: Moved in paint_fore, paint_mid and paint_back
authorJoel Holdsworth <redacted>
Sat, 13 Dec 2014 11:25:50 +0000 (11:25 +0000)
committerJoel Holdsworth <redacted>
Sun, 28 Dec 2014 15:35:57 +0000 (15:35 +0000)
pv/view/rowitem.cpp
pv/view/rowitem.hpp
pv/view/viewitem.cpp
pv/view/viewitem.hpp

index 185e03ab36d83d951a041b1698f814eb7094d6d3..5666168e4ea590087d7ec82d5511cbef7a4a42b0 100644 (file)
@@ -120,24 +120,6 @@ QPoint RowItem::point() const
        return QPoint(0, visual_v_offset());
 }
 
-void RowItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
-{
-       (void)p;
-       (void)pp;
-}
-
-void RowItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
-{
-       (void)p;
-       (void)pp;
-}
-
-void RowItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
-{
-       (void)p;
-       (void)pp;
-}
-
 void RowItem::hover_point_changed()
 {
 }
index 6688bc5c90602a7dfd48d15a17acc873a233882e..cf521ff0be88d2f030cab0c4cd4616de9728594b 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <QPropertyAnimation>
 
-#include "viewitempaintparams.hpp"
 #include "viewitem.hpp"
 
 namespace pv {
@@ -105,27 +104,6 @@ public:
         */
        virtual std::pair<int, int> v_extents() const = 0;
 
-       /**
-        * Paints the background layer of the trace with a QPainter
-        * @param p the QPainter to paint into.
-        * @param pp the painting parameters object to paint with.
-        **/
-       virtual void paint_back(QPainter &p, const ViewItemPaintParams &pp);
-
-       /**
-        * Paints the mid-layer of the trace with a QPainter
-        * @param p the QPainter to paint into.
-        * @param pp the painting parameters object to paint with.
-        **/
-       virtual void paint_mid(QPainter &p, const ViewItemPaintParams &pp);
-
-       /**
-        * Paints the foreground layer of the trace with a QPainter
-        * @param p the QPainter to paint into.
-        * @param pp the painting parameters object to paint with.
-        **/
-       virtual void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
-
        /**
         * Paints the signal label.
         * @param p the QPainter to paint into.
index 0d83ee846f01547f609c91fac8a8c85f4b566208..b3498ac159434ea6d36c2404bcedcca025e52d52 100644 (file)
@@ -85,6 +85,24 @@ QPen ViewItem::highlight_pen()
                Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
 }
 
+void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
+{
+       (void)p;
+       (void)pp;
+}
+
+void ViewItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
+{
+       (void)p;
+       (void)pp;
+}
+
+void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
+{
+       (void)p;
+       (void)pp;
+}
+
 QColor ViewItem::select_text_colour(QColor background)
 {
        return (background.lightness() > 64) ? Qt::black : Qt::white;
index 6a78b1afb583eb1c20256f936e4d0a159fd093ef..4c3df154072c8ca5f3c2b06d67d4f0ab7f5d5408 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <QPen>
 
+#include "viewitempaintparams.hpp"
+
 class QAction;
 class QMenu;
 class QWidget;
@@ -95,6 +97,27 @@ public:
         */
        virtual QRectF label_rect(const QRectF &rect) const = 0;
 
+       /**
+        * Paints the background layer of the item with a QPainter
+        * @param p the QPainter to paint into.
+        * @param pp the painting parameters object to paint with.
+        **/
+       virtual void paint_back(QPainter &p, const ViewItemPaintParams &pp);
+
+       /**
+        * Paints the mid-layer of the item with a QPainter
+        * @param p the QPainter to paint into.
+        * @param pp the painting parameters object to paint with.
+        **/
+       virtual void paint_mid(QPainter &p, const ViewItemPaintParams &pp);
+
+       /**
+        * Paints the foreground layer of the item with a QPainter
+        * @param p the QPainter to paint into.
+        * @param pp the painting parameters object to paint with.
+        **/
+       virtual void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
+
 public:
        /**
         * Gets the text colour.