From 3cd51b5034d4d3086f1ffe829fa59772fd124152 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 31 Aug 2015 20:19:43 -0600 Subject: [PATCH] ViewItem: Added a default label_rect implementation --- pv/view/viewitem.cpp | 6 ++++++ pv/view/viewitem.hpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) 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. -- 2.30.2