]> sigrok.org Git - pulseview.git/commitdiff
ViewItem: Added a default label_rect implementation
authorJoel Holdsworth <redacted>
Tue, 1 Sep 2015 02:19:43 +0000 (20:19 -0600)
committerJoel Holdsworth <redacted>
Sun, 18 Oct 2015 21:32:29 +0000 (15:32 -0600)
pv/view/viewitem.cpp
pv/view/viewitem.hpp

index 0c61578c0c2acfcb1517e40009a5a91675568caa..6ad6f6b64fbb515eb3426e13d3806754e8f862cc 100644 (file)
@@ -64,6 +64,12 @@ void ViewItem::drag_release()
        drag_point_ = QPoint(INT_MIN, INT_MIN);
 }
 
        drag_point_ = QPoint(INT_MIN, INT_MIN);
 }
 
+QRectF ViewItem::label_rect(const QRectF &rect) const
+{
+       (void)rect;
+       return QRectF();
+}
+
 QRectF ViewItem::hit_box_rect(const QRectF &rect) const
 {
        (void)rect;
 QRectF ViewItem::hit_box_rect(const QRectF &rect) const
 {
        (void)rect;
index ac404ceaa415c21c72a55834633569c99eb57e85..32b9f995fedb642783964b6287e68fbe36c9e131 100644 (file)
@@ -99,8 +99,9 @@ public:
         * Computes the outline rectangle of a label.
         * @param rect the rectangle of the header area.
         * @return Returns the rectangle of the signal label.
         * Computes the outline rectangle of a label.
         * @param rect the rectangle of the header area.
         * @return Returns the rectangle of the signal label.
+        * @remarks The default implementation returns an empty rectangle.
         */
         */
-       virtual QRectF label_rect(const QRectF &rect) const = 0;
+       virtual QRectF label_rect(const QRectF &rect) const;
 
        /**
         * Computes the outline rectangle of the viewport hit-box.
 
        /**
         * Computes the outline rectangle of the viewport hit-box.