From: Joel Holdsworth Date: Sun, 21 Dec 2014 10:58:30 +0000 (+0000) Subject: MarginWidget: Moved mouse_down_item_ in X-Git-Tag: pulseview-0.3.0~318 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f052f9cde47e2c4ab8fd189eb2dc4e85adaf491d;p=pulseview.git MarginWidget: Moved mouse_down_item_ in --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 41dffca1..81973802 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -314,8 +314,10 @@ void Header::on_group() return a->visual_v_offset() < b->visual_v_offset(); }); shared_ptr group(new TraceGroup()); + shared_ptr mouse_down_item( + std::dynamic_pointer_cast(mouse_down_item_)); shared_ptr focus_item( - mouse_down_item_ ? mouse_down_item_ : selected_items.front()); + mouse_down_item ? mouse_down_item : selected_items.front()); assert(focus_item); assert(focus_item->owner()); diff --git a/pv/view/header.hpp b/pv/view/header.hpp index 48e06a7b..62c29c16 100644 --- a/pv/view/header.hpp +++ b/pv/view/header.hpp @@ -91,9 +91,6 @@ private Q_SLOTS: Q_SIGNALS: void signals_moved(); - -private: - std::shared_ptr mouse_down_item_; }; } // namespace view diff --git a/pv/view/marginwidget.hpp b/pv/view/marginwidget.hpp index 5b6631af..a97b22c1 100644 --- a/pv/view/marginwidget.hpp +++ b/pv/view/marginwidget.hpp @@ -63,6 +63,7 @@ protected: pv::view::View &view_; QPoint mouse_point_; QPoint mouse_down_point_; + std::shared_ptr mouse_down_item_; bool dragging_; }; diff --git a/pv/view/ruler.hpp b/pv/view/ruler.hpp index cfba0489..89b9ff4c 100644 --- a/pv/view/ruler.hpp +++ b/pv/view/ruler.hpp @@ -88,9 +88,6 @@ private: int calculate_text_height() const; -private: - std::shared_ptr mouse_down_item_; - private Q_SLOTS: void hover_point_changed(); };