Skip to content

Commit

Permalink
QWT now required
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14317 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 30, 2010
1 parent 6a4b548 commit 0bd9990
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 76 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Expand Up @@ -58,8 +58,6 @@ IF (WITH_POSTGRESQL)
SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
ENDIF (WITH_POSTGRESQL)

SET (WITH_QWT TRUE CACHE BOOL "Determines whether QWT support should be included (currently used for GPS widget)")

SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")

IF (WITH_SPATIALITE)
Expand Down Expand Up @@ -137,6 +135,7 @@ FIND_PACKAGE(Expat) # GPS importer plugin
FIND_PACKAGE(GSL) # Georeferencer
FIND_PACKAGE(GEOS)
FIND_PACKAGE(GDAL)
FIND_PACKAGE(QWT REQUIRED)

IF (NOT WITH_INTERNAL_SPATIALITE)
FIND_PACKAGE(Sqlite3)
Expand All @@ -149,9 +148,6 @@ ENDIF (NOT WITH_INTERNAL_SPATIALITE)
IF (WITH_POSTGRESQL)
FIND_PACKAGE(Postgres) # PostgreSQL provider, SPIT plugin
ENDIF (WITH_POSTGRESQL)
IF (WITH_QWT)
FIND_PACKAGE(QWT)
ENDIF(WITH_QWT)

IF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)
FIND_PACKAGE(SPATIALITE)
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -185,6 +185,7 @@ for the existence of cmake and provides some clues to build QGIS.
* GEOS >= 3.0
* Sqlite3 >= 3.0.0
* GDAL/OGR >= 1.4.x
* Qwt >= 5.0

'''Optional dependencies:'''
* for GRASS plugin - GRASS >= 6.0.0 (libraries compiled with exceptions support)
Expand All @@ -193,7 +194,6 @@ for the existence of cmake and provides some clues to build QGIS.
* for gps plugin - expat >= 1.95
* for mapserver export and PyQGIS - Python >= 2.3 (2.5+ preferred)
* for PyQGIS - SIP >= 4.8, PyQt >= must match Qt version
* for GPS tracking - Qwt >= 5.0

'''Recommended runtime deps:'''
* for gps plugin - gpsbabel
Expand Down
2 changes: 1 addition & 1 deletion doc/INSTALL.t2t
Expand Up @@ -101,6 +101,7 @@ for the existence of cmake and provides some clues to build QGIS.
* GEOS >= 3.0
* Sqlite3 >= 3.0.0
* GDAL/OGR >= 1.4.x
* Qwt >= 5.0

'''Optional dependencies:'''
* for GRASS plugin - GRASS >= 6.0.0 (libraries compiled with exceptions support)
Expand All @@ -109,7 +110,6 @@ for the existence of cmake and provides some clues to build QGIS.
* for gps plugin - expat >= 1.95
* for mapserver export and PyQGIS - Python >= 2.3 (2.5+ preferred)
* for PyQGIS - SIP >= 4.8, PyQt >= must match Qt version
* for GPS tracking - Qwt >= 5.0

'''Recommended runtime deps:'''
* for gps plugin - gpsbabel
Expand Down
65 changes: 26 additions & 39 deletions src/app/CMakeLists.txt
Expand Up @@ -127,6 +127,22 @@ SET(QGIS_APP_SRCS
attributetable/qgsattributetablefiltermodel.cpp
attributetable/qgsattributetableidcolumnpair.cpp
attributetable/qgsattributetabledelegate.cpp

gps/qgsgpsinformationwidget.cpp
gps/qgsgpsmarker.cpp
gps/qwtpolar/qwt_polar_canvas.cpp
gps/qwtpolar/qwt_polar_curve.cpp
gps/qwtpolar/qwt_polar_fitter.cpp
gps/qwtpolar/qwt_polar_grid.cpp
gps/qwtpolar/qwt_polar_itemdict.cpp
gps/qwtpolar/qwt_polar_item.cpp
gps/qwtpolar/qwt_polar_layout.cpp
gps/qwtpolar/qwt_polar_magnifier.cpp
gps/qwtpolar/qwt_polar_marker.cpp
gps/qwtpolar/qwt_polar_panner.cpp
gps/qwtpolar/qwt_polar_plot.cpp
gps/qwtpolar/qwt_polar_point.cpp
gps/qwtpolar/qwt_polar_spectrogram.cpp
)


Expand Down Expand Up @@ -231,40 +247,13 @@ SET (QGIS_APP_MOC_HDRS
attributetable/qgsattributetabledialog.h
attributetable/qgsattributetabledelegate.h

gps/qgsgpsinformationwidget.h
gps/qwtpolar/qwt_polar_canvas.h
gps/qwtpolar/qwt_polar_magnifier.h
gps/qwtpolar/qwt_polar_panner.h
gps/qwtpolar/qwt_polar_plot.h
)

IF( QWT_FOUND )
ADD_DEFINITIONS(-DHAVE_QWT)

SET(QGIS_APP_SRCS
${QGIS_APP_SRCS}
gps/qgsgpsinformationwidget.cpp
gps/qgsgpsmarker.cpp
gps/qwtpolar/qwt_polar_canvas.cpp
gps/qwtpolar/qwt_polar_curve.cpp
gps/qwtpolar/qwt_polar_fitter.cpp
gps/qwtpolar/qwt_polar_grid.cpp
gps/qwtpolar/qwt_polar_itemdict.cpp
gps/qwtpolar/qwt_polar_item.cpp
gps/qwtpolar/qwt_polar_layout.cpp
gps/qwtpolar/qwt_polar_magnifier.cpp
gps/qwtpolar/qwt_polar_marker.cpp
gps/qwtpolar/qwt_polar_panner.cpp
gps/qwtpolar/qwt_polar_plot.cpp
gps/qwtpolar/qwt_polar_point.cpp
gps/qwtpolar/qwt_polar_spectrogram.cpp
)

SET (QGIS_APP_MOC_HDRS
${QGIS_APP_MOC_HDRS}
gps/qgsgpsinformationwidget.h
gps/qwtpolar/qwt_polar_canvas.h
gps/qwtpolar/qwt_polar_magnifier.h
gps/qwtpolar/qwt_polar_panner.h
gps/qwtpolar/qwt_polar_plot.h
)
ENDIF( QWT_FOUND )

IF (POSTGRES_FOUND)
IF(HAVE_PGCONFIG)
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
Expand Down Expand Up @@ -388,13 +377,11 @@ TARGET_LINK_LIBRARIES(qgis
qgis_gui
)

IF( QWT_FOUND )
IF( WIN32 )
ADD_DEFINITIONS(-DQWT_DLL)
ENDIF( WIN32 )
INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(qgis ${QWT_LIBRARY})
ENDIF( QWT_FOUND )
IF( WIN32 )
ADD_DEFINITIONS(-DQWT_DLL)
ENDIF( WIN32 )
INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(qgis ${QWT_LIBRARY})

IF(NOT WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis ${SQLITE_LIBRARY})
Expand Down
21 changes: 1 addition & 20 deletions src/app/qgisapp.cpp
Expand Up @@ -160,10 +160,7 @@
#include "qgstilescalewidget.h"
#include "qgsquerybuilder.h"
#include "qgsattributeaction.h"

#ifdef HAVE_QWT
#include "qgsgpsinformationwidget.h"
#endif

//
// Gdal/Ogr includes
Expand Down Expand Up @@ -372,9 +369,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
#ifdef Q_OS_WIN
, mSkipNextContextMenuEvent( 0 )
#endif
#ifdef HAVE_QWT
, mpGpsWidget( NULL )
#endif
{
if ( smInstance )
{
Expand Down Expand Up @@ -643,13 +638,11 @@ void QgisApp::readSettings()
{
showTileScale();
}
#if HAVE_QWT
// Restore state of GPS Tracker
if ( settings.value( "/gps/widgetEnabled", false ).toBool() )
{
showGpsTool();
}
#endif
}


Expand Down Expand Up @@ -1084,13 +1077,11 @@ void QgisApp::createActions()
connect( mActionTileScale, SIGNAL( triggered() ), this, SLOT( showTileScale() ) );
mActionTileScale->setEnabled( true );

#ifdef HAVE_QWT
mActionGpsTool = new QAction( getThemeIcon( "mActionGpsTool.png" ), tr( "Live GPS tracking" ), this );
shortcuts->registerAction( mActionGpsTool, tr( "", "Live GPS tracking" ) );
mActionGpsTool->setStatusTip( tr( "Show GPS tool" ) );
connect( mActionGpsTool, SIGNAL( triggered() ), this, SLOT( showGpsTool() ) );
mActionGpsTool->setEnabled( true );
#endif

mActionLayerProperties = new QAction( tr( "Properties..." ), this );
shortcuts->registerAction( mActionLayerProperties );
Expand Down Expand Up @@ -1501,9 +1492,7 @@ void QgisApp::createMenus()

mViewMenu->addAction( mActionTileScale );

#ifdef HAVE_QWT
mViewMenu->addAction( mActionGpsTool );
#endif

// Layers Menu

Expand Down Expand Up @@ -2426,7 +2415,6 @@ void QgisApp::saveWindowState()
settings.setValue( "/UI/tileScaleEnabled", false );
}

#if HAVE_QWT
// Persist state of GPS Tracker
if ( mpGpsWidget )
{
Expand All @@ -2437,7 +2425,6 @@ void QgisApp::saveWindowState()
{
settings.setValue( "/gps/widgetEnabled", false );
}
#endif

QgsPluginRegistry::instance()->unloadAll();
}
Expand Down Expand Up @@ -2497,11 +2484,7 @@ void QgisApp::about()
versionString += tr( "\nThis copy of QGIS has been built without SpatiaLite support." );
#endif

#ifdef HAVE_QWT
versionString += tr( "\nThis copy of QGIS has been built with QWT support (%1)." ).arg( QWT_VERSION_STR );
#else
versionString += tr( "\nThis copy of QGIS has been built without QWT support." );
#endif
versionString += tr( "\nThis copy of QGIS has been built with QWT %1." ).arg( QWT_VERSION_STR );

#ifdef QGISDEBUG
versionString += tr( "\nThis copy of QGIS writes debugging output." );
Expand Down Expand Up @@ -5021,7 +5004,6 @@ void QgisApp::removeLayer()

void QgisApp::showGpsTool()
{
#ifdef HAVE_QWT
if ( !mpGpsWidget )
{
mpGpsWidget = new QgsGPSInformationWidget( mMapCanvas );
Expand All @@ -5040,7 +5022,6 @@ void QgisApp::showGpsTool()
{
mpGpsDock->setVisible( mpGpsDock->isHidden() );
}
#endif
}

void QgisApp::showTileScale()
Expand Down
10 changes: 0 additions & 10 deletions src/app/qgisapp.h
Expand Up @@ -67,9 +67,7 @@ class QNetworkReply;
class QNetworkProxy;
class QAuthenticator;

#ifdef HAVE_QWT
class QgsGPSInformationWidget;
#endif

#include <QMainWindow>
#include <QToolBar>
Expand Down Expand Up @@ -285,9 +283,7 @@ class QgisApp : public QMainWindow
QAction *actionLayerSelectionSaveAs() { return mActionLayerSelectionSaveAs; }
QAction *actionRemoveLayer() { return mActionRemoveLayer; }
QAction *actionTileScale() { return mActionTileScale; }
#ifdef HAVE_QWT
QAction *actionGpsTool() { return mActionGpsTool; }
#endif
QAction *actionLayerProperties() { return mActionLayerProperties; }
QAction *actionLayerSubsetString() { return mActionLayerSubsetString; }
QAction *actionLayerSeparator2() { return mActionLayerSeparator2; }
Expand Down Expand Up @@ -944,9 +940,7 @@ class QgisApp : public QMainWindow
QAction *mActionLayerSelectionSaveAs;
QAction *mActionRemoveLayer;
QAction *mActionTileScale;
#ifdef HAVE_QWT
QAction *mActionGpsTool;
#endif
QAction *mActionLayerProperties;
QAction *mActionLayerSubsetString;
QAction *mActionLayerSeparator2;
Expand Down Expand Up @@ -1009,9 +1003,7 @@ class QgisApp : public QMainWindow
QDockWidget *mLegendDock;
QDockWidget *mOverviewDock;
QDockWidget *mpTileScaleDock;
#ifdef HAVE_QWT
QDockWidget *mpGpsDock;
#endif

#ifdef Q_WS_MAC
//! Window menu action to select this window
Expand Down Expand Up @@ -1172,10 +1164,8 @@ class QgisApp : public QMainWindow
int mSkipNextContextMenuEvent; // ugly hack
#endif

#ifdef HAVE_QWT
//! Persistent GPS toolbox
QgsGPSInformationWidget * mpGpsWidget;
#endif

QgsPalLabeling* mLBL;

Expand Down

0 comments on commit 0bd9990

Please sign in to comment.