Fixed compilation problem with Qwt 6.1

master
ismagom 11 years ago
parent eb52aeb1ab
commit 5e810e8a7d

@ -36,13 +36,6 @@
SET(QWT_FOUND "NO") SET(QWT_FOUND "NO")
FIND_PATH(QWT_INCLUDE_DIR qwt.h FIND_PATH(QWT_INCLUDE_DIR qwt.h
/usr/local/qwt/include
/usr/local/include
/usr/include/qwt
/usr/include/qwt-qt4
/usr/include/qwt5
/usr/include
/opt/local/include/qwt #macports path
$ENV{QWT_DIR}/include $ENV{QWT_DIR}/include
$ENV{QWT_DIR}/src $ENV{QWT_DIR}/src
$ENV{QWTDIR}/include $ENV{QWTDIR}/include
@ -51,6 +44,13 @@ FIND_PATH(QWT_INCLUDE_DIR qwt.h
$ENV{QWT_ROOT}/src $ENV{QWT_ROOT}/src
$ENV{QWTROOT}/include $ENV{QWTROOT}/include
$ENV{QWTROOT}/src $ENV{QWTROOT}/src
/usr/local/qwt/include
/usr/local/include
/usr/include/qwt
/usr/include/qwt-qt4
/usr/include/qwt5
/usr/include
/opt/local/include/qwt #macports path
) )
SET(QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR}) SET(QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR})
@ -82,8 +82,16 @@ IF( Qwt_FIND_VERSION AND QWT_VERSION_STRING )
ENDIF() ENDIF()
ENDIF() ENDIF()
SET(POTENTIAL_LIBRARY_PATHS /usr/local/qwt/lib /usr/local/lib /usr/lib /opt/local/lib SET(POTENTIAL_LIBRARY_PATHS
$ENV{QWT_DIR}/lib $ENV{QWTDIR}/lib $ENV{QWT_ROOT}/lib $ENV{QWTROOT}/lib) $ENV{QWT_DIR}/lib
$ENV{QWTDIR}/lib
$ENV{QWT_ROOT}/lib
$ENV{QWTROOT}/lib
/usr/local/qwt/lib
/usr/local/lib /usr/lib
/opt/local/lib
)
SET(QWT_NAMES ${QWT_NAMES} qwt qwt-qt4 qwt5 ) SET(QWT_NAMES ${QWT_NAMES} qwt qwt-qt4 qwt5 )
FIND_LIBRARY(QWT_LIBRARY FIND_LIBRARY(QWT_LIBRARY

@ -33,6 +33,8 @@
#include "Lineplot.h" #include "Lineplot.h"
#include "qwt_scale_div.h"
#include "qwt_plot_canvas.h"
#include <algorithm> #include <algorithm>
class MyZoomer: public QwtPlotZoomer class MyZoomer: public QwtPlotZoomer
@ -94,7 +96,8 @@ Lineplot::Lineplot(QWidget *parent)
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating,true); axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating,true);
axisScaleEngine(QwtPlot::yRight)->setAttribute(QwtScaleEngine::Floating,true); axisScaleEngine(QwtPlot::yRight)->setAttribute(QwtScaleEngine::Floating,true);
zoomer_ = new MyZoomer(canvas()); QwtPlotCanvas *mycanvas = qobject_cast<QwtPlotCanvas*>(canvas());
zoomer_ = new MyZoomer(mycanvas);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton); zoomer_->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect2, Qt::LeftButton, zoomer_->setMousePattern(QwtEventPattern::MouseSelect2, Qt::LeftButton,
Qt::ControlModifier); Qt::ControlModifier);
@ -160,5 +163,5 @@ void Lineplot::resetZoom()
void Lineplot::linkScales() void Lineplot::linkScales()
{ {
setAxisScaleDiv(QwtPlot::yRight, *axisScaleDiv(QwtPlot::yLeft)); // setAxisScaleDiv(QwtPlot::yRight, *axisScaleDiv(QwtPlot::yLeft));
} }

@ -32,6 +32,7 @@
*/ */
#include "Pointplot.h" #include "Pointplot.h"
#include "qwt_plot_canvas.h"
#include <algorithm> #include <algorithm>
using namespace std; using namespace std;
@ -83,7 +84,8 @@ Pointplot::Pointplot(QWidget *parent)
memset(realPoints_, 0x0, numPoints_*sizeof(double)); memset(realPoints_, 0x0, numPoints_*sizeof(double));
memset(imagPoints_, 0x0, numPoints_*sizeof(double)); memset(imagPoints_, 0x0, numPoints_*sizeof(double));
zoomer_ = new MyZoomer(canvas()); QwtPlotCanvas *mycanvas = qobject_cast<QwtPlotCanvas*>(canvas());
zoomer_ = new MyZoomer(mycanvas);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton); zoomer_->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect2, Qt::LeftButton, zoomer_->setMousePattern(QwtEventPattern::MouseSelect2, Qt::LeftButton,
Qt::ControlModifier); Qt::ControlModifier);

@ -36,6 +36,7 @@
#include <qprinter.h> #include <qprinter.h>
#include <qprintdialog.h> #include <qprintdialog.h>
#include <qwt_color_map.h> #include <qwt_color_map.h>
#include <qwt_plot_canvas.h>
#include <qwt_plot_spectrogram.h> #include <qwt_plot_spectrogram.h>
#include <qwt_scale_widget.h> #include <qwt_scale_widget.h>
#include <qwt_scale_draw.h> #include <qwt_scale_draw.h>
@ -116,7 +117,8 @@ Spectrogramplot::Spectrogramplot(int numDataPoints, int numRows, QWidget *parent
// RightButton: zoom out by 1 // RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size // Ctrl+RighButton: zoom out to full size
zoomer_ = new MyZoomer(canvas()); QwtPlotCanvas *mycanvas = qobject_cast<QwtPlotCanvas*>(canvas());
zoomer_ = new MyZoomer(mycanvas);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect1, zoomer_->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton); Qt::LeftButton);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect2, zoomer_->setMousePattern(QwtEventPattern::MouseSelect2,

Loading…
Cancel
Save