From: Soeren Apel Date: Wed, 12 Nov 2014 17:16:47 +0000 (+0100) Subject: Trace: Introduce hover_point_changed() X-Git-Tag: pulseview-0.3.0~500 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9555ca8b3fdddd62496ebaaada2d9c0f980df03e;p=pulseview.git Trace: Introduce hover_point_changed() --- diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index f450f45b..b0e08f6f 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -546,6 +546,10 @@ pair DecodeTrace::get_sample_range(int x_start, int x_end) c return make_pair(start, end); } +void DecodeTrace::hover_point_changed() +{ +} + void DecodeTrace::create_decoder_form(int index, shared_ptr &dec, QWidget *parent, QFormLayout *form) diff --git a/pv/view/decodetrace.h b/pv/view/decodetrace.h index f71894d0..e172cf8f 100644 --- a/pv/view/decodetrace.h +++ b/pv/view/decodetrace.h @@ -153,6 +153,8 @@ private: */ std::pair get_sample_range(int x_start, int x_end) const; + void hover_point_changed(); + void create_decoder_form(int index, std::shared_ptr &dec, QWidget *parent, QFormLayout *form); diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index f23de2ff..61a002bb 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -42,6 +42,7 @@ const QPen Trace::AxisPen(QColor(128, 128, 128, 64)); const int Trace::LabelHitPadding = 2; Trace::Trace(QString name) : + _view(NULL), _name(name), _v_offset(0), _popup(NULL), @@ -82,7 +83,15 @@ void Trace::set_v_offset(int v_offset) void Trace::set_view(pv::view::View *view) { assert(view); + + if (_view) + disconnect(_view, SIGNAL(hover_point_changed()), + this, SLOT(on_hover_point_changed())); + _view = view; + + connect(view, SIGNAL(hover_point_changed()), + this, SLOT(on_hover_point_changed())); } void Trace::paint_back(QPainter &p, int left, int right) @@ -271,6 +280,10 @@ void Trace::populate_popup_form(QWidget *parent, QFormLayout *form) add_colour_option(parent, form); } +void Trace::hover_point_changed() +{ +} + void Trace::on_popup_closed() { _popup = NULL; @@ -289,5 +302,10 @@ void Trace::on_colour_changed(const QColor &colour) colour_changed(); } +void Trace::on_hover_point_changed() +{ + hover_point_changed(); +} + } // namespace view } // namespace pv diff --git a/pv/view/trace.h b/pv/view/trace.h index 4866b558..5f54ea1d 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -172,6 +172,8 @@ protected: virtual void populate_popup_form(QWidget *parent, QFormLayout *form); + virtual void hover_point_changed(); + private Q_SLOTS: void on_text_changed(const QString &text); @@ -179,6 +181,8 @@ private Q_SLOTS: void on_popup_closed(); + void on_hover_point_changed(); + Q_SIGNALS: void visibility_changed(); void text_changed();