X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitem.hpp;h=dd3d2aa0c2c61a4969a53c6a5fc899cb5c7e802b;hp=eb0823e47e8f1b55b897597a0c8bf14a0b960742;hb=c373f82810ad9c5376a7370118de9dd587ee0e43;hpb=23e75650eba0491b2636de3cef87f893e38ae6f3 diff --git a/pv/view/viewitem.hpp b/pv/view/viewitem.hpp index eb0823e4..dd3d2aa0 100644 --- a/pv/view/viewitem.hpp +++ b/pv/view/viewitem.hpp @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_VIEWITEM_H -#define PULSEVIEW_PV_VIEWITEM_H +#ifndef PULSEVIEW_PV_VIEWITEM_HPP +#define PULSEVIEW_PV_VIEWITEM_HPP #include @@ -39,6 +39,8 @@ class Popup; namespace view { +class ViewItemOwner; + class ViewItem : public QObject { Q_OBJECT @@ -100,6 +102,14 @@ public: */ virtual QRectF label_rect(const QRectF &rect) const = 0; + /** + * Computes the outline rectangle of the viewport hit-box. + * @param rect the rectangle of the viewport area. + * @return Returns the rectangle of the hit-box. + * @remarks The default implementation returns an empty hit-box. + */ + virtual QRectF hit_box_rect(const QRectF &rect) const; + /** * Paints the signal label. * @param p the QPainter to paint into. @@ -141,7 +151,7 @@ public: public: virtual QMenu* create_context_menu(QWidget *parent); - virtual pv::widgets::Popup* create_popup(QWidget *parent) = 0; + virtual pv::widgets::Popup* create_popup(QWidget *parent); virtual void delete_pressed(); @@ -159,4 +169,4 @@ private: } // namespace view } // namespace pv -#endif // PULSEVIEW_PV_VIEWITEM_H +#endif // PULSEVIEW_PV_VIEWITEM_HPP