From: Joel Holdsworth Date: Tue, 1 Sep 2015 02:19:43 +0000 (-0600) Subject: ViewItem: Added a default label_rect implementation X-Git-Tag: pulseview-0.3.0~75 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=3cd51b5034d4d3086f1ffe829fa59772fd124152 ViewItem: Added a default label_rect implementation --- diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index 0c61578c..6ad6f6b6 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -64,6 +64,12 @@ void ViewItem::drag_release() 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; diff --git a/pv/view/viewitem.hpp b/pv/view/viewitem.hpp index ac404cea..32b9f995 100644 --- a/pv/view/viewitem.hpp +++ b/pv/view/viewitem.hpp @@ -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. + * @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.