From: Joel Holdsworth Date: Wed, 14 Oct 2015 03:28:14 +0000 (-0600) Subject: TraceTreeItem: Update when selection state changes X-Git-Tag: pulseview-0.3.0~78 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=75663e3ab6656ed9fc39050d8ac6752450b6a4ad;p=pulseview.git TraceTreeItem: Update when selection state changes --- diff --git a/pv/view/tracetreeitem.cpp b/pv/view/tracetreeitem.cpp index 89bf4667..21fecb7e 100644 --- a/pv/view/tracetreeitem.cpp +++ b/pv/view/tracetreeitem.cpp @@ -35,6 +35,12 @@ TraceTreeItem::TraceTreeItem() : { } +void TraceTreeItem::select(bool select) +{ + ViewItem::select(select); + owner_->row_item_appearance_changed(true, true); +} + int TraceTreeItem::layout_v_offset() const { return layout_v_offset_; diff --git a/pv/view/tracetreeitem.hpp b/pv/view/tracetreeitem.hpp index 8a72f6eb..c41b67d7 100644 --- a/pv/view/tracetreeitem.hpp +++ b/pv/view/tracetreeitem.hpp @@ -51,6 +51,11 @@ public: */ TraceTreeItemOwner* owner() const; + /** + * Selects or deselects the signal. + */ + void select(bool select = true); + /** * Gets the vertical layout offset of this signal. */ diff --git a/pv/view/viewwidget.cpp b/pv/view/viewwidget.cpp index 69e34566..38732046 100644 --- a/pv/view/viewwidget.cpp +++ b/pv/view/viewwidget.cpp @@ -48,7 +48,6 @@ void ViewWidget::clear_selection() const auto items = this->items(); for (auto &i : items) i->select(false); - update(); } void ViewWidget::item_hover(const shared_ptr &item) @@ -187,7 +186,6 @@ void ViewWidget::mouse_left_press_event(QMouseEvent *event) drag(); selection_changed(); - update(); } void ViewWidget::mouse_left_release_event(QMouseEvent *event)