]> sigrok.org Git - pulseview.git/commitdiff
TimeItem: Made paint_label a mandatory field
authorJoel Holdsworth <redacted>
Mon, 8 Dec 2014 23:45:05 +0000 (23:45 +0000)
committerUwe Hermann <redacted>
Wed, 10 Dec 2014 17:06:16 +0000 (18:06 +0100)
pv/view/cursorheader.cpp
pv/view/cursorpair.cpp
pv/view/cursorpair.hpp
pv/view/timeitem.hpp

index 7fc02add408c19438f6c3ea4bce980cd9dc5db64..981a958b8d0d94ec3d515fcfba3dce82844c8d76 100644 (file)
@@ -78,7 +78,7 @@ void CursorHeader::paintEvent(QPaintEvent*)
 
        // Draw the cursors
        if (view_.cursors_shown())
-               view_.cursors()->draw_markers(p, r);
+               view_.cursors()->paint_label(p, r);
 }
 
 void CursorHeader::mouseMoveEvent(QMouseEvent *e)
index 2ad8eef6b50f818478dfdec875be9031676c7145..2ff32c53ef9fbbe4d46b2d1d8fb22425ee03626f 100644 (file)
@@ -101,7 +101,7 @@ QRectF CursorPair::label_rect(const QRectF &rect) const
                right - left, height);
 }
 
-void CursorPair::draw_markers(QPainter &p, const QRect &rect)
+void CursorPair::paint_label(QPainter &p, const QRect &rect)
 {
        assert(first_);
        assert(second_);
index 43e06545ad4fd94cfe6690dc473906fa9fd3d910..47ca694bc07b622fdad6dcdcef17a7222651496d 100644 (file)
@@ -74,7 +74,7 @@ public:
 public:
        QRectF label_rect(const QRectF &rect) const;
 
-       void draw_markers(QPainter &p, const QRect &rect);
+       void paint_label(QPainter &p, const QRect &rect);
 
        void draw_viewport_background(QPainter &p, const QRect &rect);
 
index ff2664a664b17a7163574c446a217304845406a3..02d22d218c29b6e7dd953f764e3560afc623bdfc 100644 (file)
@@ -47,6 +47,13 @@ public:
 
        virtual float get_x() const = 0;
 
+       /**
+        * Paints the marker's label to the ruler.
+        * @param p The painter to draw with.
+        * @param rect The rectangle of the ruler client area.
+        */
+       virtual void paint_label(QPainter &p, const QRect &rect) = 0;
+
 protected:
        View &view_;
 };