From d16393700d1f286fb2c67ea53ddebaad151f4803 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <tom@trondeau.com>
Date: Tue, 17 Dec 2013 19:22:03 -0500
Subject: qtgui: enables use of QWT 6.1.

---
 gr-qtgui/lib/TimeDomainDisplayPlot.cc | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

(limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')

diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index 8d6563003e..8be3f904a6 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -61,7 +61,11 @@ protected:
 class TimeDomainDisplayZoomer: public QwtPlotZoomer, public TimePrecisionClass
 {
 public:
+#if QWT_VERSION < 0x060100
   TimeDomainDisplayZoomer(QwtPlotCanvas* canvas, const unsigned int timePrecision)
+#else /* QWT_VERSION < 0x060100 */
+  TimeDomainDisplayZoomer(QWidget* canvas, const unsigned int timePrecision)
+#endif /* QWT_VERSION < 0x060100 */
     : QwtPlotZoomer(canvas),TimePrecisionClass(timePrecision)
   {
     setTrackerMode(QwtPicker::AlwaysOn);
@@ -393,6 +397,17 @@ TimeDomainDisplayPlot::legendEntryChecked(QwtPlotItem* plotItem, bool on)
   DisplayPlot::legendEntryChecked(plotItem, on);
 }
 
+void
+TimeDomainDisplayPlot::legendEntryChecked(const QVariant &plotItem, bool on, int index)
+{
+#if QWT_VERSION < 0x060100
+  std::runtime_error("TimeDomainDisplayPlot::legendEntryChecked with QVariant not enabled in this version of QWT.\n");
+#else
+  QwtPlotItem *p = infoToItem(plotItem);
+  legendEntryChecked(p, on);
+#endif /* QWT_VERSION < 0x060100 */
+}
+
 void
 TimeDomainDisplayPlot::_resetXAxisPoints()
 {
@@ -490,7 +505,11 @@ TimeDomainDisplayPlot::setSemilogx(bool en)
     setAxisScaleEngine(QwtPlot::xBottom, new QwtLinearScaleEngine);
   }
   else {
+#if QWT_VERSION < 0x060100
     setAxisScaleEngine(QwtPlot::xBottom, new QwtLog10ScaleEngine);
+#else /* QWT_VERSION < 0x060100 */
+    setAxisScaleEngine(QwtPlot::xBottom, new QwtLogScaleEngine);
+#endif /*QWT_VERSION < 0x060100 */
   }
   _resetXAxisPoints();
 }
@@ -500,13 +519,23 @@ TimeDomainDisplayPlot::setSemilogy(bool en)
 {
   if(d_semilogy != en) {
     d_semilogy = en;
+
+#if QWT_VERSION < 0x060100
     double max = axisScaleDiv(QwtPlot::yLeft)->upperBound();
+#else /* QWT_VERSION < 0x060100 */
+    double max = axisScaleDiv(QwtPlot::yLeft).upperBound();
+#endif /* QWT_VERSION < 0x060100 */
+
     if(!d_semilogy) {
       setAxisScaleEngine(QwtPlot::yLeft, new QwtLinearScaleEngine);
       setYaxis(-pow(10.0, max/10.0), pow(10.0, max/10.0));
     }
     else {
+#if QWT_VERSION < 0x060100
       setAxisScaleEngine(QwtPlot::yLeft, new QwtLog10ScaleEngine);
+#else /* QWT_VERSION < 0x060100 */
+      setAxisScaleEngine(QwtPlot::yLeft, new QwtLogScaleEngine);
+#endif /*QWT_VERSION < 0x060100 */
       setYaxis(1e-10, 10.0*log10(max));
     }
   }
-- 
cgit v1.2.3