]> sigrok.org Git - pulseview.git/commitdiff
Trace: Introduce hover_point_changed()
authorSoeren Apel <redacted>
Wed, 12 Nov 2014 17:16:47 +0000 (18:16 +0100)
committerUwe Hermann <redacted>
Thu, 13 Nov 2014 19:16:53 +0000 (20:16 +0100)
pv/view/decodetrace.cpp
pv/view/decodetrace.h
pv/view/trace.cpp
pv/view/trace.h

index f450f45b819207f1871aeb4f3dbf574e84d5d325..b0e08f6f1cfa16fb957284b99232f4206b7eea67 100644 (file)
@@ -546,6 +546,10 @@ pair<uint64_t, uint64_t> 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<data::decode::Decoder> &dec, QWidget *parent,
        QFormLayout *form)
index f71894d0cff9968158ce74c8a57328abbd7bd033..e172cf8fb1999b9b81420f583d9284745d85a8c3 100644 (file)
@@ -153,6 +153,8 @@ private:
         */
        std::pair<uint64_t, uint64_t> get_sample_range(int x_start, int x_end) const;
 
+       void hover_point_changed();
+
        void create_decoder_form(int index,
                std::shared_ptr<pv::data::decode::Decoder> &dec,
                QWidget *parent, QFormLayout *form);
index f23de2ff50b33cb2771468584b8b4c5051bf3fab..61a002bb80f422a042f300c9d01526b04d810730 100644 (file)
@@ -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
index 4866b558ca3d537b4c671450d0a9f0a9bcf37f44..5f54ea1ddb0e16bcb35393a415e29b97eae8c00a 100644 (file)
@@ -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();