X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitem.cpp;h=e9602f8790ddcec61767509cd694524cbd3d8cd6;hp=a9c9b3dd8095673a8ef73717e965a2c4163ef13b;hb=a009d21992db132679e27030736ed614522245ea;hpb=20dd116e6f728645b4c9c8ba6c74f535759d7a1a diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index a9c9b3dd..e9602f87 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -49,6 +49,11 @@ void ViewItem::select(bool select) selected_ = select; } +bool ViewItem::is_draggable() const +{ + return true; +} + bool ViewItem::dragging() const { return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN; @@ -56,7 +61,8 @@ bool ViewItem::dragging() const void ViewItem::drag() { - drag_point_ = point(QRect()); + if (is_draggable()) + drag_point_ = point(QRect()); } void ViewItem::drag_release() @@ -64,18 +70,30 @@ void ViewItem::drag_release() drag_point_ = QPoint(INT_MIN, INT_MIN); } -QRectF ViewItem::hit_box_rect(const QRectF &rect) const +QRectF ViewItem::label_rect(const QRectF &rect) const { (void)rect; return QRectF(); } +QRectF ViewItem::hit_box_rect(const ViewItemPaintParams &pp) const +{ + (void)pp; + return QRectF(); +} + QMenu* ViewItem::create_context_menu(QWidget *parent) { context_parent_ = parent; return new QMenu(parent); } +widgets::Popup* ViewItem::create_popup(QWidget *parent) +{ + (void)parent; + return nullptr; +} + void ViewItem::delete_pressed() { } @@ -87,6 +105,13 @@ QPen ViewItem::highlight_pen() Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); } +void ViewItem::paint_label(QPainter &p, const QRect &rect, bool hover) +{ + (void)p; + (void)rect; + (void)hover; +} + void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp) { (void)p;