]> sigrok.org Git - pulseview.git/commitdiff
TraceTreeItem: Update when selection state changes
authorJoel Holdsworth <redacted>
Wed, 14 Oct 2015 03:28:14 +0000 (21:28 -0600)
committerJoel Holdsworth <redacted>
Sun, 18 Oct 2015 21:32:29 +0000 (15:32 -0600)
pv/view/tracetreeitem.cpp
pv/view/tracetreeitem.hpp
pv/view/viewwidget.cpp

index 89bf466788224bb2518abc2fb3f3c9370e11ce6c..21fecb7e30f779ec71364caacde4faafe7f567cf 100644 (file)
@@ -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_;
index 8a72f6ebd59217e0ec7522cc514205b09d69ea64..c41b67d75d1d2ab1a2dc503048d80d7c4241b63b 100644 (file)
@@ -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.
         */
index 69e345660ab3558cf677ef66a2d7b7083602b65a..38732046f11f896756a79536e0a94db79234e8ae 100644 (file)
@@ -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<ViewItem> &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)