diff options
author | Tom Rondeau <tom@trondeau.com> | 2013-12-17 19:22:03 -0500 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2013-12-18 23:45:37 -0500 |
commit | d16393700d1f286fb2c67ea53ddebaad151f4803 (patch) | |
tree | 3efb1de19a3ed0d21debe9067a194cf75072ca6d /gr-qtgui/lib/TimeDomainDisplayPlot.cc | |
parent | b3b8a1f4965f8283f2c3d22ae45b569b2fe6d713 (diff) |
qtgui: enables use of QWT 6.1.
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.cc | 29 |
1 files changed, 29 insertions, 0 deletions
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); @@ -394,6 +398,17 @@ TimeDomainDisplayPlot::legendEntryChecked(QwtPlotItem* plotItem, bool 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() { double delt = 1.0/d_sample_rate; @@ -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)); } } |