X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fviewitem.cpp;h=7e581d952bcd00d8cc3f2ec4dd491fd74e5d24fb;hb=4df7756e87d3acfdd71603c2105c0ef54e58cc85;hp=a9c9b3dd8095673a8ef73717e965a2c4163ef13b;hpb=20dd116e6f728645b4c9c8ba6c74f535759d7a1a;p=pulseview.git diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index a9c9b3dd..7e581d95 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -27,7 +27,8 @@ #include namespace pv { -namespace view { +namespace views { +namespace TraceView { const QSizeF ViewItem::LabelPadding(4, 0); const int ViewItem::HighlightRadius = 3; @@ -49,6 +50,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 +62,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 +71,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 +106,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; @@ -110,5 +136,6 @@ QColor ViewItem::select_text_colour(QColor background) return (background.lightness() > 110) ? Qt::black : Qt::white; } -} // namespace view +} // namespace TraceView +} // namespace views } // namespace pv