From: Joel Holdsworth Date: Sat, 13 Dec 2014 15:52:54 +0000 (+0000) Subject: TimeMarker: Replaced time_changed signal with View::time_item_apparance_changed X-Git-Tag: pulseview-0.3.0~347 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=98cfe4e8dadad2cf710eb46fd5c85d9d0520a875;p=pulseview.git TimeMarker: Replaced time_changed signal with View::time_item_apparance_changed --- diff --git a/pv/view/timemarker.cpp b/pv/view/timemarker.cpp index 8eed6e7e..ed9df360 100644 --- a/pv/view/timemarker.cpp +++ b/pv/view/timemarker.cpp @@ -67,7 +67,7 @@ void TimeMarker::set_time(double time) updating_value_widget_ = false; } - time_changed(); + view_.time_item_appearance_changed(true, true); } float TimeMarker::get_x() const @@ -186,10 +186,8 @@ pv::widgets::Popup* TimeMarker::create_popup(QWidget *parent) void TimeMarker::on_value_changed(double value) { - if (!updating_value_widget_) { - time_ = value; - time_changed(); - } + if (!updating_value_widget_) + set_time(value); } } // namespace view diff --git a/pv/view/timemarker.hpp b/pv/view/timemarker.hpp index 7534dbd7..864a4e38 100644 --- a/pv/view/timemarker.hpp +++ b/pv/view/timemarker.hpp @@ -103,9 +103,6 @@ public: private Q_SLOTS: void on_value_changed(double value); -Q_SIGNALS: - void time_changed(); - protected: const QColor &colour_; diff --git a/pv/view/view.cpp b/pv/view/view.cpp index c53c02e3..d58e074a 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -121,11 +121,6 @@ View::View(Session &session, QWidget *parent) : connect(&session_, SIGNAL(frame_ended()), this, SLOT(data_updated())); - connect(cursors_->first().get(), SIGNAL(time_changed()), - this, SLOT(marker_time_changed())); - connect(cursors_->second().get(), SIGNAL(time_changed()), - this, SLOT(marker_time_changed())); - connect(header_, SIGNAL(signals_moved()), this, SLOT(on_signals_moved())); @@ -615,6 +610,14 @@ void View::row_item_appearance_changed(bool label, bool content) viewport_->update(); } +void View::time_item_appearance_changed(bool label, bool content) +{ + if (label) + cursorheader_->update(); + if (content) + viewport_->update(); +} + void View::extents_changed(bool horz, bool vert) { sticky_events_ |= @@ -728,12 +731,6 @@ void View::data_updated() viewport_->update(); } -void View::marker_time_changed() -{ - cursorheader_->update(); - viewport_->update(); -} - void View::on_signals_moved() { update_scroll(); diff --git a/pv/view/view.hpp b/pv/view/view.hpp index 9ba86b72..6a249c22 100644 --- a/pv/view/view.hpp +++ b/pv/view/view.hpp @@ -232,6 +232,7 @@ private: public: void row_item_appearance_changed(bool label, bool content); + void time_item_appearance_changed(bool label, bool content); void extents_changed(bool horz, bool vert); @@ -243,8 +244,6 @@ private Q_SLOTS: void signals_changed(); void data_updated(); - void marker_time_changed(); - void on_signals_moved(); void process_sticky_events();