Merge pull request #23 from suttonpd/master

Adding Qwt6.1 support
master
Ismael Gómez-Miguelez 11 years ago
commit 788ec3269e

@ -35,22 +35,25 @@
SET(QWT_FOUND "NO") SET(QWT_FOUND "NO")
SET(HINT_INCLUDE_PATHS $ENV{QWT_DIR}/include
$ENV{QWT_DIR}/src
$ENV{QWTDIR}/include
$ENV{QWTDIR}/src
$ENV{QWT_ROOT}/include
$ENV{QWT_ROOT}/src
$ENV{QWTROOT}/include
$ENV{QWTROOT}/src)
SET(POTENTIAL_INCLUDE_PATHS /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
FIND_PATH(QWT_INCLUDE_DIR qwt.h FIND_PATH(QWT_INCLUDE_DIR qwt.h
/usr/local/qwt/include HINTS ${HINT_INCLUDE_PATHS}
/usr/local/include PATHS ${POTENTIAL_INCLUDE_PATHS}
/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}/src
$ENV{QWTDIR}/include
$ENV{QWTDIR}/src
$ENV{QWT_ROOT}/include
$ENV{QWT_ROOT}/src
$ENV{QWTROOT}/include
$ENV{QWTROOT}/src
) )
SET(QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR}) SET(QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR})
@ -82,12 +85,19 @@ 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
$ENV{QWT_DIR}/lib $ENV{QWTDIR}/lib $ENV{QWT_ROOT}/lib $ENV{QWTROOT}/lib)
SET(QWT_NAMES ${QWT_NAMES} qwt qwt-qt4 qwt5 ) SET(QWT_NAMES ${QWT_NAMES} qwt qwt-qt4 qwt5 )
SET(HINT_LIBRARY_PATHS $ENV{QWT_DIR}/lib
$ENV{QWTDIR}/lib
$ENV{QWT_ROOT}/lib
$ENV{QWTROOT}/lib)
SET(POTENTIAL_LIBRARY_PATHS /usr/local/qwt/lib
/usr/local/lib
/usr/lib
/opt/local/lib)
FIND_LIBRARY(QWT_LIBRARY FIND_LIBRARY(QWT_LIBRARY
NAMES ${QWT_NAMES} NAMES ${QWT_NAMES}
HINTS ${HINT_LIBRARY_PATHS}
PATHS ${POTENTIAL_LIBRARY_PATHS} PATHS ${POTENTIAL_LIBRARY_PATHS}
) )
MARK_AS_ADVANCED(QWT_LIBRARY) MARK_AS_ADVANCED(QWT_LIBRARY)
@ -99,6 +109,7 @@ IF (QWT_LIBRARY)
SET(QWT_NAMES_DEBUG qwtd qwtd-qt4 qwtd5 ) SET(QWT_NAMES_DEBUG qwtd qwtd-qt4 qwtd5 )
FIND_LIBRARY(QWT_LIBRARY_DEBUG FIND_LIBRARY(QWT_LIBRARY_DEBUG
NAMES ${QWT_NAMES_DEBUG} NAMES ${QWT_NAMES_DEBUG}
HINTS ${HINT_LIBRARY_PATHS}
PATHS ${POTENTIAL_LIBRARY_PATHS} PATHS ${POTENTIAL_LIBRARY_PATHS}
) )
MARK_AS_ADVANCED(QWT_LIBRARY_DEBUG) MARK_AS_ADVANCED(QWT_LIBRARY_DEBUG)

@ -94,7 +94,7 @@ 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()); zoomer_ = new MyZoomer(qobject_cast<QwtPlotCanvas*>(canvas()));
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 +160,9 @@ void Lineplot::resetZoom()
void Lineplot::linkScales() void Lineplot::linkScales()
{ {
#if QWT_VERSION < 0x060100
setAxisScaleDiv(QwtPlot::yRight, *axisScaleDiv(QwtPlot::yLeft)); setAxisScaleDiv(QwtPlot::yRight, *axisScaleDiv(QwtPlot::yLeft));
#else // QWT_VERSION < 0x060100
setAxisScaleDiv(QwtPlot::yRight, axisScaleDiv(QwtPlot::yLeft));
#endif // QWT_VERSION < 0x060100
} }

@ -83,7 +83,7 @@ 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()); zoomer_ = new MyZoomer(qobject_cast<QwtPlotCanvas*>(canvas()));
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,7 @@ 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()); zoomer_ = new MyZoomer(qobject_cast<QwtPlotCanvas*>(canvas()));
zoomer_->setMousePattern(QwtEventPattern::MouseSelect1, zoomer_->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton); Qt::LeftButton);
zoomer_->setMousePattern(QwtEventPattern::MouseSelect2, zoomer_->setMousePattern(QwtEventPattern::MouseSelect2,

@ -61,5 +61,6 @@ void plot_exit() {
if (plot_initiated) { if (plot_initiated) {
pthread_cancel(thread); pthread_cancel(thread);
} }
plot_initiated=0;
} }

Loading…
Cancel
Save