summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/DisplayPlot.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2013-12-19 00:49:04 -0500
committerTom Rondeau <tom@trondeau.com>2013-12-19 00:49:04 -0500
commitce38418384e2a398e59873d084fefe9db3158bad (patch)
tree2accc82b07bc63095bae603f0e00e10d96b0b505 /gr-qtgui/lib/DisplayPlot.cc
parent2039f6e353952c3ad1530d852cef318de9fe3d4d (diff)
parentd16393700d1f286fb2c67ea53ddebaad151f4803 (diff)
Merge branch 'maint'
Diffstat (limited to 'gr-qtgui/lib/DisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/DisplayPlot.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/gr-qtgui/lib/DisplayPlot.cc b/gr-qtgui/lib/DisplayPlot.cc
index 50661aba02..61ed16bd7b 100644
--- a/gr-qtgui/lib/DisplayPlot.cc
+++ b/gr-qtgui/lib/DisplayPlot.cc
@@ -27,6 +27,7 @@
#include <QColor>
#include <cmath>
#include <iostream>
+#include <stdexcept>
#include <QDebug>
DisplayPlot::DisplayPlot(int nplots, QWidget* parent)
@@ -89,9 +90,15 @@ DisplayPlot::DisplayPlot(int nplots, QWidget* parent)
#endif /* QWT_VERSION < 0x060100 */
insertLegend(legendDisplay);
-
connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool)),
this, SLOT(legendEntryChecked(QwtPlotItem *, bool)));
+#else /* QWT_VERSION < 0x060100 */
+ legendDisplay->setDefaultItemMode(QwtLegendData::Checkable);
+ insertLegend(legendDisplay);
+ connect(legendDisplay, SIGNAL(checked(const QVariant&, bool, int)),
+ this, SLOT(legendEntryChecked(const QVariant&, bool, int)));
+#endif /* QWT_VERSION < 0x060100 */
+
}
DisplayPlot::~DisplayPlot()
@@ -409,6 +416,16 @@ void DisplayPlot::legendEntryChecked(QwtPlotItem* plotItem, bool on)
replot();
}
+void DisplayPlot::legendEntryChecked(const QVariant &plotItem, bool on, int index)
+{
+#if QWT_VERSION < 0x060100
+ std::runtime_error("DisplayPlot::legendEntryChecked with QVariant not enabled in this version of QWT.\n");
+#else
+ QwtPlotItem *p = infoToItem(plotItem);
+ legendEntryChecked(p, on);
+#endif /* QWT_VERSION < 0x060100 */
+}
+
void
DisplayPlot::onPickerPointSelected(const QwtDoublePoint & p)
{