From: Joel Holdsworth Date: Sun, 21 Dec 2014 13:41:28 +0000 (+0000) Subject: MarginWidget: Moved in clear_selection X-Git-Tag: pulseview-0.3.0~311 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5a6a4ce3e32a250cd586f4755573ed3bed530d7b;p=pulseview.git MarginWidget: Moved in clear_selection --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 83985eda..1cbe59ce 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -94,13 +94,6 @@ shared_ptr Header::get_mouse_over_item(const QPoint &pt) return shared_ptr(); } -void Header::clear_selection() -{ - for (auto &i : view_) - i->select(false); - update(); -} - void Header::paintEvent(QPaintEvent*) { // The trace labels are not drawn with the arrows exactly on the diff --git a/pv/view/header.hpp b/pv/view/header.hpp index 867944c5..34f851b6 100644 --- a/pv/view/header.hpp +++ b/pv/view/header.hpp @@ -74,8 +74,6 @@ private: std::shared_ptr get_mouse_over_item( const QPoint &pt); - void clear_selection(); - private: void paintEvent(QPaintEvent *event); diff --git a/pv/view/marginwidget.cpp b/pv/view/marginwidget.cpp index 8716439e..2ef26276 100644 --- a/pv/view/marginwidget.cpp +++ b/pv/view/marginwidget.cpp @@ -68,6 +68,10 @@ void MarginWidget::contextMenuEvent(QContextMenuEvent *event) void MarginWidget::clear_selection() { + const auto items = this->items(); + for (auto &i : items) + i->select(false); + update(); } } // namespace view diff --git a/pv/view/marginwidget.hpp b/pv/view/marginwidget.hpp index 4bd7ac18..7df6c02d 100644 --- a/pv/view/marginwidget.hpp +++ b/pv/view/marginwidget.hpp @@ -73,7 +73,7 @@ private: virtual void contextMenuEvent(QContextMenuEvent *event); public Q_SLOTS: - virtual void clear_selection(); + void clear_selection(); Q_SIGNALS: void selection_changed(); diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 21dd16ff..fb40e117 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -51,14 +51,6 @@ Ruler::Ruler(View &parent) : this, SLOT(hover_point_changed())); } -void Ruler::clear_selection() -{ - const vector< shared_ptr > items(view_.time_items()); - for (auto &i : items) - i->select(false); - update(); -} - QSize Ruler::sizeHint() const { const int text_height = calculate_text_height(); diff --git a/pv/view/ruler.hpp b/pv/view/ruler.hpp index 418d3982..ce9cae30 100644 --- a/pv/view/ruler.hpp +++ b/pv/view/ruler.hpp @@ -48,9 +48,6 @@ private: public: Ruler(View &parent); -public: - void clear_selection(); - public: QSize sizeHint() const;