From: Joel Holdsworth Date: Fri, 10 Oct 2014 20:27:41 +0000 (+0100) Subject: RowItem: Combined appearance change signals into appearance_changed() X-Git-Tag: pulseview-0.3.0~464 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=6dcdb3258f6f0b25e69154b5919405a194b7e724 RowItem: Combined appearance change signals into appearance_changed() --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ef18566..8e2ac695 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,7 @@ set(pulseview_HEADERS pv/view/header.h pv/view/logicsignal.h pv/view/marginwidget.h + pv/view/rowitem.h pv/view/ruler.h pv/view/selectableitem.h pv/view/signal.h diff --git a/pv/view/rowitem.h b/pv/view/rowitem.h index 90036389..161e8289 100644 --- a/pv/view/rowitem.h +++ b/pv/view/rowitem.h @@ -30,6 +30,8 @@ class RowItemOwner; class RowItem : public SelectableItem { + Q_OBJECT + public: /** * Constructor. @@ -111,6 +113,9 @@ public: public: virtual void hover_point_changed(); +Q_SIGNALS: + void appearance_changed(); + protected: pv::view::RowItemOwner *_owner; diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index fab76fcf..cbd5ac42 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -85,7 +85,7 @@ bool Signal::enabled() const void Signal::enable(bool enable) { _channel->set_enabled(enable); - visibility_changed(); + appearance_changed(); } shared_ptr Signal::channel() const diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index 3409ecf7..3b92abe4 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -223,13 +223,13 @@ void Trace::on_popup_closed() void Trace::on_text_changed(const QString &text) { set_name(text); - text_changed(); + appearance_changed(); } void Trace::on_colour_changed(const QColor &colour) { set_colour(colour); - colour_changed(); + appearance_changed(); } } // namespace view diff --git a/pv/view/trace.h b/pv/view/trace.h index 7fd8c67a..83eb8265 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -126,11 +126,6 @@ private Q_SLOTS: void on_popup_closed(); -Q_SIGNALS: - void visibility_changed(); - void text_changed(); - void colour_changed(); - protected: QString _name; QColor _colour; diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index afff74ee..22171405 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -229,7 +229,7 @@ void Viewport::on_signals_changed() { for (shared_ptr r : _view) { assert(r); - connect(r.get(), SIGNAL(visibility_changed()), + connect(r.get(), SIGNAL(appearance_changed()), this, SLOT(update())); } }