Trace: Converted on_hover_point_changed signal to direct notification
[pulseview.git] / pv / view / view.cpp
index 11026883bab1a7842dba1483c1c58c8b0650cb72..af0892b81d1fb4d85003b179ce38f99d72369676 100644 (file)
@@ -119,6 +119,9 @@ View::View(SigSession &session, QWidget *parent) :
        connect(_cursorheader, SIGNAL(selection_changed()),
                this, SIGNAL(selection_changed()));
 
+       connect(this, SIGNAL(hover_point_changed()),
+               this, SLOT(on_hover_point_changed()));
+
        setViewport(_viewport);
 
        _viewport->installEventFilter(this);
@@ -145,6 +148,16 @@ const SigSession& View::session() const
        return _session;
 }
 
+Viewport* View::viewport()
+{
+       return _viewport;
+}
+
+const Viewport* View::viewport() const
+{
+       return _viewport;
+}
+
 double View::scale() const
 {
        return _scale;
@@ -552,5 +565,12 @@ void View::on_geometry_updated()
        update_layout();
 }
 
+void View::on_hover_point_changed()
+{
+       const vector< shared_ptr<Trace> > traces(get_traces());
+       for (shared_ptr<Trace> t : traces)
+               t->hover_point_changed();
+}
+
 } // namespace view
 } // namespace pv