summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/TimeDomainDisplayPlot.cc
diff options
context:
space:
mode:
authorMike Cornelius <dr@drelectro.com>2011-04-11 00:48:29 -0400
committerTom Rondeau <trondeau@vt.edu>2011-04-12 22:28:58 -0400
commit41ad09b4f22228dd555ea73f2078cb9ff056b979 (patch)
tree2e2fd86e367ce5cf0203a0e426f786e88f5c7555 /gr-qtgui/lib/TimeDomainDisplayPlot.cc
parent9ad807544990bf4a4a8f5fb746f33b796258f9ee (diff)
gr-qtgui: adding double-click point selector to main gui widgets.
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index da28d03044..be25a6cde2 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -82,6 +82,7 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(QWidget* parent):QwtPlot(parent)
_xAxisPoints = new double[_numPoints];
_zoomer = new TimeDomainDisplayZoomer(canvas(), 0);
+ _zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
// Disable polygon clipping
QwtPainter::setDeviceClipping(false);
@@ -135,6 +136,15 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(QWidget* parent):QwtPlot(parent)
_panner->setAxisEnabled(QwtPlot::yRight, false);
_panner->setMouseButton(Qt::MidButton);
+ // emit the position of clicks on widget
+ _picker = new QwtDblClickPlotPicker(canvas());
+ connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
+ this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+
+ // Configure magnify on mouse wheel
+ _magnifier = new QwtPlotMagnifier(canvas());
+ _magnifier->setAxisEnabled(QwtPlot::xBottom, false);
+
// Avoid jumping when labels with more/less digits
// appear/disappear when scrolling vertically
@@ -269,4 +279,12 @@ TimeDomainDisplayPlot::SetSampleRate(double sr, double units,
}
}
+void
+TimeDomainDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
+{
+ QPointF point = p;
+ //fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
+ emit plotPointSelected(point);
+}
+
#endif /* TIME_DOMAIN_DISPLAY_PLOT_C */