From 8f60bc5095d86505595bd053b1c8e57d2f7f1a43 Mon Sep 17 00:00:00 2001 From: timlinux Date: Sun, 31 Aug 2008 18:28:22 +0000 Subject: [PATCH] More api cleanups mainly affecting gui git-svn-id: http://svn.osgeo.org/qgis/trunk@9233 c8812cc2-4d05-0410-92ff-de0c093fc19c --- python/gui/qgisinterface.sip | 2 +- python/gui/qgsmapcanvas.sip | 16 +++++----- python/gui/qgsmapcanvasitem.sip | 4 +-- python/gui/qgsmapcanvasmap.sip | 2 +- python/gui/qgsmapoverviewcanvas.sip | 2 +- python/gui/qgsmaptool.sip | 12 +++---- python/gui/qgsmaptoolpan.sip | 2 +- python/gui/qgsmaptoolzoom.sip | 2 +- src/app/legend/qgslegend.cpp | 10 +++--- src/app/legend/qgslegend.h | 2 +- src/app/legend/qgslegendlayerfile.cpp | 14 ++++---- src/app/legend/qgslegendlayerfile.h | 4 +-- src/app/qgisapp.cpp | 18 +++++------ src/app/qgisapp.h | 4 +-- src/app/qgisappinterface.cpp | 4 +-- src/app/qgisappinterface.h | 2 +- src/app/qgsmaptooladdfeature.cpp | 2 +- src/app/qgsmaptooladdvertex.cpp | 2 +- src/app/qgsmaptoolcapture.cpp | 4 +-- src/app/qgsmaptooledit.cpp | 4 +-- src/app/qgsmaptoolidentify.cpp | 2 +- src/app/qgsmaptoolmovefeature.cpp | 10 +++--- src/app/qgsmaptoolmovevertex.cpp | 2 +- src/app/qgsmaptoolselect.cpp | 2 +- src/core/qgsprojectfiletransform.cpp | 2 +- src/gui/qgisinterface.h | 2 +- src/gui/qgsmapcanvas.cpp | 32 +++++++++---------- src/gui/qgsmapcanvas.h | 18 +++++------ src/gui/qgsmapcanvasitem.cpp | 8 ++--- src/gui/qgsmapcanvasitem.h | 4 +-- src/gui/qgsmapcanvasmap.h | 2 +- src/gui/qgsmapoverviewcanvas.cpp | 4 +-- src/gui/qgsmapoverviewcanvas.h | 2 +- src/gui/qgsmaptool.cpp | 18 +++++------ src/gui/qgsmaptool.h | 14 ++++---- src/gui/qgsmaptoolemitpoint.cpp | 2 +- src/gui/qgsmaptoolpan.h | 2 +- src/gui/qgsmaptoolzoom.h | 2 +- src/gui/qgsrubberband.cpp | 2 +- src/gui/qgsvertexmarker.cpp | 2 +- .../georeferencer/qgsgeorefdatapoint.cpp | 2 +- src/plugins/georeferencer/qgspointdialog.cpp | 2 +- src/plugins/grass/qgsgrassedittools.cpp | 8 ++--- src/plugins/grass/qgsgrassregion.cpp | 8 ++--- src/plugins/maplayer/maplayertest.cpp | 4 +-- 45 files changed, 134 insertions(+), 134 deletions(-) diff --git a/python/gui/qgisinterface.sip b/python/gui/qgisinterface.sip index 0b118591013..75fe4acc68b 100644 --- a/python/gui/qgisinterface.sip +++ b/python/gui/qgisinterface.sip @@ -31,7 +31,7 @@ class QgisInterface : QObject //! Zoom to full extent of map layers virtual void zoomFull()=0; //! Zoom to previous view extent - virtual void zoomPrevious()=0; + virtual void zoomToPrevious()=0; //! Zoome to extent of the active layer virtual void zoomActiveLayer()=0; diff --git a/python/gui/qgsmapcanvas.sip b/python/gui/qgsmapcanvas.sip index 43f063881f8..c0eddcd91d5 100644 --- a/python/gui/qgsmapcanvas.sip +++ b/python/gui/qgsmapcanvas.sip @@ -11,13 +11,13 @@ class QgsMapCanvasLayer %End public: - QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool inOverview = FALSE); + QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool isInOverview = FALSE); void setVisible(bool visible); - void setInOverview(bool inOverview); + void setInOverview(bool isInOverview); bool isVisible() const; - bool inOverview() const; + bool isInOverview() const; QgsMapLayer* layer(); //const QgsMapLayer* layer() const; @@ -68,7 +68,7 @@ class QgsMapCanvas : QGraphicsView QPixmap& canvasPixmap(); //! Get the last reported scale of the canvas - double getScale(); + double scale(); //! Clear the map canvas void clear(); @@ -85,10 +85,10 @@ class QgsMapCanvas : QGraphicsView void setExtent(const QgsRect & r); //! Zoom to the full extent of all layers - void zoomFullExtent(); + void zoomToFullExtent(); //! Zoom to the previous extent (view) - void zoomPreviousExtent(); + void zoomToPreviousExtent(); /**Zooms to the extend of the selected features*/ void zoomToSelected(); @@ -165,7 +165,7 @@ class QgsMapCanvas : QGraphicsView void enableAntiAliasing(bool theFlag); //! Select which Qt class to render with - void useQImageToRender(bool theFlag); + void useImageToRender(bool theFlag); // following 2 methods should be moved elsewhere or changed to private // currently used by pan map tool @@ -272,7 +272,7 @@ class QgsMapCanvas : QGraphicsView void moveCanvasContents(bool reset = FALSE); //! called on resize or changed extent to notify canvas items to change their rectangle - void updateCanvasItemsPositions(); + void updateCanvasItemPositions(); }; // class QgsMapCanvas diff --git a/python/gui/qgsmapcanvasitem.sip b/python/gui/qgsmapcanvasitem.sip index 1885a243adf..b3456eb4837 100644 --- a/python/gui/qgsmapcanvasitem.sip +++ b/python/gui/qgsmapcanvasitem.sip @@ -42,10 +42,10 @@ class QgsMapCanvasItem : QGraphicsItem void setRect(const QgsRect& r); //! transformation from screen coordinates to map coordinates - QgsPoint toMapCoords(const QPoint& point); + QgsPoint toMapCoordinates(const QPoint& point); //! transformation from map coordinates to screen coordinates - QPointF toCanvasCoords(const QgsPoint& point); + QPointF toCanvasCoordinates(const QgsPoint& point); }; diff --git a/python/gui/qgsmapcanvasmap.sip b/python/gui/qgsmapcanvasmap.sip index f885b137154..05143f08a52 100644 --- a/python/gui/qgsmapcanvasmap.sip +++ b/python/gui/qgsmapcanvasmap.sip @@ -33,7 +33,7 @@ class QgsMapCanvasMap : QGraphicsRectItem void enableAntiAliasing(bool flag); - void useQImageToRender(bool flag); + void useImageToRender(bool flag); //! renders map using QgsMapRender to mPixmap void render(); diff --git a/python/gui/qgsmapoverviewcanvas.sip b/python/gui/qgsmapoverviewcanvas.sip index cb7e4a29021..ffc691eae43 100644 --- a/python/gui/qgsmapoverviewcanvas.sip +++ b/python/gui/qgsmapoverviewcanvas.sip @@ -17,7 +17,7 @@ class QgsMapOverviewCanvas : QWidget void refresh(); //! changes background color - void setbgColor(const QColor& color); + void setBackgroundColor(const QColor& color); //! updates layer set for overview void setLayerSet(const QStringList& layerSet); diff --git a/python/gui/qgsmaptool.sip b/python/gui/qgsmaptool.sip index b8a8e380cbd..2c090886708 100644 --- a/python/gui/qgsmaptool.sip +++ b/python/gui/qgsmaptool.sip @@ -57,7 +57,7 @@ class QgsMapTool : QObject /** Check whether this MapTool performs a zoom or pan operation. * If it does, we will be able to perform the zoom and then * resume operations with the original / previously used tool.*/ - virtual bool isZoomTool(); + virtual bool isTransient(); /** Check whether this MapTool performs an edit operation. * If it does, we will deactivate it when editing is turned off @@ -76,19 +76,19 @@ class QgsMapTool : QObject QgsMapTool(QgsMapCanvas* canvas /TransferThis/); //! transformation from screen coordinates to map coordinates - QgsPoint toMapCoords(const QPoint& point); + QgsPoint toMapCoordinates(const QPoint& point); //! transformation from screen coordinates to layer's coordinates - QgsPoint toLayerCoords(QgsMapLayer* layer, const QPoint& point); + QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QPoint& point); //! trnasformation from map coordinates to layer's coordinates - QgsPoint toLayerCoords(QgsMapLayer* layer, const QgsPoint& point); + QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QgsPoint& point); //! trnasformation of the rect from map coordinates to layer's coordinates - QgsRect toLayerCoords(QgsMapLayer* layer, const QgsRect& rect); + QgsRect toLayerCoordinates(QgsMapLayer* layer, const QgsRect& rect); //! transformation from map coordinates to screen coordinates - QPoint toCanvasCoords(const QgsPoint& point); + QPoint toCanvasCoordinates(const QgsPoint& point); }; diff --git a/python/gui/qgsmaptoolpan.sip b/python/gui/qgsmaptoolpan.sip index d4bd53a0015..6a923e722f0 100644 --- a/python/gui/qgsmaptoolpan.sip +++ b/python/gui/qgsmaptoolpan.sip @@ -18,7 +18,7 @@ class QgsMapToolPan : QgsMapTool //! Overridden mouse release event virtual void canvasReleaseEvent(QMouseEvent * e); - virtual bool isZoomTool(); + virtual bool isTransient(); }; diff --git a/python/gui/qgsmaptoolzoom.sip b/python/gui/qgsmaptoolzoom.sip index 2316c7a11f0..8169b2e18cb 100644 --- a/python/gui/qgsmaptoolzoom.sip +++ b/python/gui/qgsmaptoolzoom.sip @@ -18,7 +18,7 @@ class QgsMapToolZoom : QgsMapTool //! Overridden mouse release event virtual void canvasReleaseEvent(QMouseEvent * e); - virtual bool isZoomTool(); + virtual bool isTransient(); }; diff --git a/src/app/legend/qgslegend.cpp b/src/app/legend/qgslegend.cpp index 319d4f6b2f0..30964ef79ae 100755 --- a/src/app/legend/qgslegend.cpp +++ b/src/app/legend/qgslegend.cpp @@ -511,7 +511,7 @@ void QgsLegend::addLayer( QgsMapLayer * layer ) // first layer? if ( mMapCanvas->layerCount() == 1 ) - mMapCanvas->zoomFullExtent(); + mMapCanvas->zoomToFullExtent(); setCurrentItem( llayer ); //make the QTreeWidget item up-to-date doItemsLayout(); @@ -910,7 +910,7 @@ bool QgsLegend::writeXML( QDomNode & legendnode, QDomDocument & document ) legendlayerfilenode.setAttribute( "visible", llf->isVisible() ); // show in overview flag - legendlayerfilenode.setAttribute( "inOverview", llf->isInOverview() ); + legendlayerfilenode.setAttribute( "isInOverview", llf->isInOverview() ); } break; @@ -1035,7 +1035,7 @@ bool QgsLegend::readXML( QDomNode& legendnode ) // load layer's visibility and 'show in overview' flag theLegendLayerFile->setVisible( atoi( childelem.attribute( "visible", "1" ).toUtf8() ) ); //Default is visible - theLegendLayerFile->setInOverview( atoi( childelem.attribute( "inOverview" ).toUtf8() ) ); + theLegendLayerFile->setInOverview( atoi( childelem.attribute( "isInOverview" ).toUtf8() ) ); // set the check state blockSignals( true ); @@ -1399,7 +1399,7 @@ void QgsLegend::updateOverview() mMapCanvas->updateOverview(); } -void QgsLegend::setOverviewAllLayers( bool inOverview ) +void QgsLegend::setOverviewAllLayers( bool isInOverview ) { QTreeWidgetItem* theItem = firstItem(); while ( theItem ) @@ -1407,7 +1407,7 @@ void QgsLegend::setOverviewAllLayers( bool inOverview ) QgsLegendLayerFile* llf = dynamic_cast( theItem ); if ( llf ) { - llf->setInOverview( inOverview ); + llf->setInOverview( isInOverview ); } theItem = nextItem( theItem ); } diff --git a/src/app/legend/qgslegend.h b/src/app/legend/qgslegend.h index b6c42d3fe23..3821712875a 100755 --- a/src/app/legend/qgslegend.h +++ b/src/app/legend/qgslegend.h @@ -154,7 +154,7 @@ class QgsLegend : public QTreeWidget void updateOverview(); /**Show/remove all layer in/from overview*/ - void setOverviewAllLayers( bool inOverview ); + void setOverviewAllLayers( bool isInOverview ); /**Adds an entry to mPixmapWidthValues*/ void addPixmapWidthValue( int width ); diff --git a/src/app/legend/qgslegendlayerfile.cpp b/src/app/legend/qgslegendlayerfile.cpp index bbf61b25b5a..1bc8618173a 100644 --- a/src/app/legend/qgslegendlayerfile.cpp +++ b/src/app/legend/qgslegendlayerfile.cpp @@ -102,7 +102,7 @@ void QgsLegendLayerFile::updateLegendItem() { QPixmap pix = legend()->pixmaps().mOriginalPixmap; - if ( mLyr.inOverview() ) + if ( mLyr.isInOverview() ) { //add overview glasses to the pixmap QPainter p( &pix ); @@ -130,12 +130,12 @@ void QgsLegendLayerFile::updateLegendItem() } -void QgsLegendLayerFile::setIconAppearance( bool inOverview, +void QgsLegendLayerFile::setIconAppearance( bool isInOverview, bool editable ) { QPixmap newIcon( getOriginalPixmap() ); - if ( inOverview ) + if ( isInOverview ) { // Overlay the overview icon on the default icon QPixmap myPixmap = QgisApp::getThemePixmap( "mIconOverview.png" ); @@ -189,14 +189,14 @@ bool QgsLegendLayerFile::isVisible() return mLyr.isVisible(); } -void QgsLegendLayerFile::setInOverview( bool inOverview ) +void QgsLegendLayerFile::setInOverview( bool isInOverview ) { - mLyr.setInOverview( inOverview ); + mLyr.setInOverview( isInOverview ); } bool QgsLegendLayerFile::isInOverview() { - return mLyr.inOverview(); + return mLyr.isInOverview(); } void QgsLegendLayerFile::showInOverview() @@ -333,7 +333,7 @@ void QgsLegendLayerFile::addToPopupMenu( QMenu& theMenu, QAction* toggleEditingA QAction* showInOverviewAction = theMenu.addAction( tr( "&Show in overview" ), this, SLOT( showInOverview() ) ); showInOverviewAction->setCheckable( true ); showInOverviewAction->blockSignals( true ); - showInOverviewAction->setChecked( mLyr.inOverview() ); + showInOverviewAction->setChecked( mLyr.isInOverview() ); showInOverviewAction->blockSignals( false ); // remove from canvas diff --git a/src/app/legend/qgslegendlayerfile.h b/src/app/legend/qgslegendlayerfile.h index d00284a88c4..0ae84c5689a 100644 --- a/src/app/legend/qgslegendlayerfile.h +++ b/src/app/legend/qgslegendlayerfile.h @@ -46,7 +46,7 @@ class QgsLegendLayerFile : public QgsLegendItem QPixmap getOriginalPixmap() const; - void setIconAppearance( bool inOverview, bool editable ); + void setIconAppearance( bool isInOverview, bool editable ); /**Returns a label for a layer. Is static such that the name can be passed to the constructor of QgsLegendLayerFile*/ @@ -55,7 +55,7 @@ class QgsLegendLayerFile : public QgsLegendItem void setVisible( bool visible = TRUE ); bool isVisible(); - void setInOverview( bool inOverview = TRUE ); + void setInOverview( bool isInOverview = TRUE ); bool isInOverview(); /** called to add appropriate menu items to legend's popup menu */ diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index f84bab061ad..05e817cb92d 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -728,7 +728,7 @@ void QgisApp::createActions() mActionZoomLast = new QAction( getThemeIcon( "mActionZoomLast.png" ), tr( "Zoom Last" ), this ); //mActionZoomLast->setShortcut(tr("Ctrl+O","Zoom to Last Extent")); mActionZoomLast->setStatusTip( tr( "Zoom to Last Extent" ) ); - connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomPrevious() ) ); + connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) ); mActionZoomActualSize = new QAction( tr( "Zoom Actual Size" ), this ); mActionZoomActualSize->setStatusTip( tr( "Zoom to Actual Size" ) ); @@ -825,7 +825,7 @@ void QgisApp::createActions() mActionAddToOverview = new QAction( getThemeIcon( "mActionInOverview.png" ), tr( "Add to Overview" ), this ); mActionAddToOverview->setShortcut( tr( "O", "Add current layer to overview map" ) ); mActionAddToOverview->setStatusTip( tr( "Add current layer to overview map" ) ); - connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( inOverview() ) ); + connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( isInOverview() ) ); mActionAddToOverview->setEnabled( false ); mActionAddAllToOverview = new QAction( getThemeIcon( "mActionAddAllToOverview.png" ), tr( "Add All to Overview" ), this ); @@ -1596,7 +1596,7 @@ void QgisApp::createOverview() // moved here to set anti aliasing to both map canvas and overview QSettings mySettings; mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing", false ).toBool() ); - mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() ); + mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() ); int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt(); double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble(); @@ -3650,15 +3650,15 @@ void QgisApp::pan() void QgisApp::zoomFull() { - mMapCanvas->zoomFullExtent(); + mMapCanvas->zoomToFullExtent(); // notify the project we've made a change QgsProject::instance()->dirty( true ); } -void QgisApp::zoomPrevious() +void QgisApp::zoomToPrevious() { - mMapCanvas->zoomPreviousExtent(); + mMapCanvas->zoomToPreviousExtent(); // notify the project we've made a change QgsProject::instance()->dirty( true ); @@ -4078,7 +4078,7 @@ void QgisApp::showScale( double theScale ) void QgisApp::userScale() { - double currentScale = mMapCanvas->getScale(); + double currentScale = mMapCanvas->scale(); QStringList parts = mScaleEdit->text().split( ':' ); if ( parts.size() == 2 ) @@ -4096,7 +4096,7 @@ void QgisApp::userScale() // toggle overview status -void QgisApp::inOverview() +void QgisApp::isInOverview() { mMapLegend->legendLayerShowInOverview(); } @@ -4477,7 +4477,7 @@ void QgisApp::options() QSettings mySettings; mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing" ).toBool() ); - mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() ); + mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() ); int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt(); double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble(); diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h index 69f056e63f1..facd288651d 100644 --- a/src/app/qgisapp.h +++ b/src/app/qgisapp.h @@ -312,7 +312,7 @@ class QgisApp : public QMainWindow //! Zoom to full extent void zoomFull(); //! Zoom to the previous extent - void zoomPrevious(); + void zoomToPrevious(); //! Zoom to selected features void zoomToSelected(); @@ -358,7 +358,7 @@ class QgisApp : public QMainWindow void addDatabaseLayer(); //#endif /** toggles whether the current selected layer is in overview or not */ - void inOverview(); + void isInOverview(); //! Slot to show the map coordinate position of the mouse cursor void showMouseCoordinate( QgsPoint & ); //! Slot to show current map scale; diff --git a/src/app/qgisappinterface.cpp b/src/app/qgisappinterface.cpp index 7a876374db2..eb6dd59d269 100644 --- a/src/app/qgisappinterface.cpp +++ b/src/app/qgisappinterface.cpp @@ -47,9 +47,9 @@ void QgisAppInterface::zoomFull() qgis->zoomFull(); } -void QgisAppInterface::zoomPrevious() +void QgisAppInterface::zoomToPrevious() { - qgis->zoomPrevious(); + qgis->zoomToPrevious(); } void QgisAppInterface::zoomActiveLayer() diff --git a/src/app/qgisappinterface.h b/src/app/qgisappinterface.h index 6c0826d2479..0b6a733b2f8 100644 --- a/src/app/qgisappinterface.h +++ b/src/app/qgisappinterface.h @@ -46,7 +46,7 @@ class QgisAppInterface : public QgisInterface //! Zoom map to full extent void zoomFull(); //! Zoom map to previous extent - void zoomPrevious(); + void zoomToPrevious(); //! Zoom to active layer void zoomActiveLayer(); diff --git a/src/app/qgsmaptooladdfeature.cpp b/src/app/qgsmaptooladdfeature.cpp index 95388542d30..f6f7eb4b21b 100644 --- a/src/app/qgsmaptooladdfeature.cpp +++ b/src/app/qgsmaptooladdfeature.cpp @@ -103,7 +103,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e ) idPoint = snapPointFromResults( snapResults, e->pos() ); try { - savePoint = toLayerCoords( vlayer, idPoint ); + savePoint = toLayerCoordinates( vlayer, idPoint ); QgsDebugMsg( "savePoint = " + savePoint.toString() ); } catch ( QgsCsException &cse ) diff --git a/src/app/qgsmaptooladdvertex.cpp b/src/app/qgsmaptooladdvertex.cpp index bc5008346d1..3251f4f0188 100644 --- a/src/app/qgsmaptooladdvertex.cpp +++ b/src/app/qgsmaptooladdvertex.cpp @@ -92,7 +92,7 @@ void QgsMapToolAddVertex::canvasReleaseEvent( QMouseEvent * e ) if ( mSnapper.snapToBackgroundLayers( e->pos(), snapResults ) == 0 ) { snappedPointMapCoord = snapPointFromResults( snapResults, e->pos() ); - snappedPointLayerCoord = toLayerCoords( vlayer, snappedPointMapCoord ); + snappedPointLayerCoord = toLayerCoordinates( vlayer, snappedPointMapCoord ); //and change the feature points QList::iterator sr_it = mRecentSnappingResults.begin(); diff --git a/src/app/qgsmaptoolcapture.cpp b/src/app/qgsmaptoolcapture.cpp index 0a1a6c080d0..20d7d1b7dfd 100644 --- a/src/app/qgsmaptoolcapture.cpp +++ b/src/app/qgsmaptoolcapture.cpp @@ -102,7 +102,7 @@ int QgsMapToolCapture::addVertex( const QPoint& p ) QgsPoint digitisedPoint; try { - digitisedPoint = toLayerCoords( vlayer, p ); + digitisedPoint = toLayerCoordinates( vlayer, p ); } catch ( QgsCsException &cse ) { @@ -119,7 +119,7 @@ int QgsMapToolCapture::addVertex( const QPoint& p ) mapPoint = snapPointFromResults( snapResults, p ); try { - layerPoint = toLayerCoords( vlayer, mapPoint ); //transform snapped point back to layer crs + layerPoint = toLayerCoordinates( vlayer, mapPoint ); //transform snapped point back to layer crs } catch ( QgsCsException &cse ) { diff --git a/src/app/qgsmaptooledit.cpp b/src/app/qgsmaptooledit.cpp index 249d5b44265..142d6ab629d 100644 --- a/src/app/qgsmaptooledit.cpp +++ b/src/app/qgsmaptooledit.cpp @@ -47,7 +47,7 @@ int QgsMapToolEdit::insertSegmentVerticesForSnap( const QList QList::iterator it = transformedSnapResults.begin(); for ( ; it != transformedSnapResults.constEnd(); ++it ) { - QgsPoint layerPoint = toLayerCoords( editedLayer, it->snappedVertex ); + QgsPoint layerPoint = toLayerCoordinates( editedLayer, it->snappedVertex ); it->snappedVertex = layerPoint; } @@ -58,7 +58,7 @@ QgsPoint QgsMapToolEdit::snapPointFromResults( const QList& s { if ( snapResults.size() < 1 ) { - return toMapCoords( screenCoords ); + return toMapCoordinates( screenCoords ); } else { diff --git a/src/app/qgsmaptoolidentify.cpp b/src/app/qgsmaptoolidentify.cpp index 2c9003db7ed..275cdf74279 100644 --- a/src/app/qgsmaptoolidentify.cpp +++ b/src/app/qgsmaptoolidentify.cpp @@ -246,7 +246,7 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point ) r.setYMinimum( point.y() - searchRadius ); r.setYMaximum( point.y() + searchRadius ); - r = toLayerCoords( layer, r ); + r = toLayerCoordinates( layer, r ); int featureCount = 0; //QgsFeature feat; diff --git a/src/app/qgsmaptoolmovefeature.cpp b/src/app/qgsmaptoolmovefeature.cpp index 206d34549c5..3f97b07f332 100644 --- a/src/app/qgsmaptoolmovefeature.cpp +++ b/src/app/qgsmaptoolmovefeature.cpp @@ -39,7 +39,7 @@ void QgsMapToolMoveFeature::canvasMoveEvent( QMouseEvent * e ) { if ( mRubberBand ) { - QgsPoint pointCanvasCoords = toMapCoords( e->pos() ); + QgsPoint pointCanvasCoords = toMapCoordinates( e->pos() ); double offsetX = pointCanvasCoords.x() - mStartPointMapCoords.x(); double offsetY = pointCanvasCoords.y() - mStartPointMapCoords.y(); mRubberBand->setTranslationOffset( offsetX, offsetY ); @@ -69,7 +69,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e ) } //find first geometry under mouse cursor and store iterator to it - QgsPoint layerCoords = toLayerCoords(( QgsMapLayer* )vlayer, e->pos() ); + QgsPoint layerCoords = toLayerCoordinates(( QgsMapLayer* )vlayer, e->pos() ); QSettings settings; double searchRadius = settings.value( "/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble(); QgsRect selectRect( layerCoords.x() - searchRadius, layerCoords.y() - searchRadius, @@ -106,7 +106,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e ) return; } - mStartPointMapCoords = toMapCoords( e->pos() ); + mStartPointMapCoords = toMapCoordinates( e->pos() ); mMovedFeature = cf.featureId(); //todo: take the closest feature, not the first one... mRubberBand = createRubberBand(); mRubberBand->setToGeometry( cf.geometry(), *vlayer ); @@ -131,8 +131,8 @@ void QgsMapToolMoveFeature::canvasReleaseEvent( QMouseEvent * e ) return; } - QgsPoint startPointLayerCoords = toLayerCoords(( QgsMapLayer* )vlayer, mStartPointMapCoords ); - QgsPoint stopPointLayerCoords = toLayerCoords(( QgsMapLayer* )vlayer, e->pos() ); + QgsPoint startPointLayerCoords = toLayerCoordinates(( QgsMapLayer* )vlayer, mStartPointMapCoords ); + QgsPoint stopPointLayerCoords = toLayerCoordinates(( QgsMapLayer* )vlayer, e->pos() ); double dx = stopPointLayerCoords.x() - startPointLayerCoords.x(); double dy = stopPointLayerCoords.y() - startPointLayerCoords.y(); diff --git a/src/app/qgsmaptoolmovevertex.cpp b/src/app/qgsmaptoolmovevertex.cpp index 5d966baff2f..df8a8b29481 100644 --- a/src/app/qgsmaptoolmovevertex.cpp +++ b/src/app/qgsmaptoolmovevertex.cpp @@ -162,7 +162,7 @@ void QgsMapToolMoveVertex::canvasReleaseEvent( QMouseEvent * e ) snappedPointMapCoord = snapPointFromResults( snapResults, e->pos() ); - snappedPointLayerCoord = toLayerCoords( vlayer, snappedPointMapCoord ); + snappedPointLayerCoord = toLayerCoordinates( vlayer, snappedPointMapCoord ); //and change the feature points QList::iterator sr_it = mRecentSnappingResults.begin(); diff --git a/src/app/qgsmaptoolselect.cpp b/src/app/qgsmaptoolselect.cpp index 1f53a504344..e5b6ed15163 100644 --- a/src/app/qgsmaptoolselect.cpp +++ b/src/app/qgsmaptoolselect.cpp @@ -92,7 +92,7 @@ void QgsMapToolSelect::canvasReleaseEvent( QMouseEvent * e ) bool lock = ( e->modifiers() & Qt::ControlModifier ); QgsVectorLayer* vlayer = dynamic_cast( mCanvas->currentLayer() ); - search = toLayerCoords( vlayer, search ); + search = toLayerCoordinates( vlayer, search ); QApplication::setOverrideCursor( Qt::WaitCursor ); vlayer->select( search, lock ); diff --git a/src/core/qgsprojectfiletransform.cpp b/src/core/qgsprojectfiletransform.cpp index eca85e02323..7226e7e8ed2 100644 --- a/src/core/qgsprojectfiletransform.cpp +++ b/src/core/qgsprojectfiletransform.cpp @@ -171,7 +171,7 @@ void QgsProjectFileTransform::transform081to090() legendLayerFile.setAttribute( "visible", mapLayer.attribute( "visible" ) ); // Set overview flag from maplayer to legendlayer - legendLayerFile.setAttribute( "inOverview", mapLayer.attribute( "showInOverviewFlag" ) ); + legendLayerFile.setAttribute( "isInOverview", mapLayer.attribute( "showInOverviewFlag" ) ); } } } diff --git a/src/gui/qgisinterface.h b/src/gui/qgisinterface.h index bc3078d787b..430caca19fa 100644 --- a/src/gui/qgisinterface.h +++ b/src/gui/qgisinterface.h @@ -64,7 +64,7 @@ class GUI_EXPORT QgisInterface : public QObject //! Zoom to full extent of map layers virtual void zoomFull() = 0; //! Zoom to previous view extent - virtual void zoomPrevious() = 0; + virtual void zoomToPrevious() = 0; //! Zoome to extent of the active layer virtual void zoomActiveLayer() = 0; diff --git a/src/gui/qgsmapcanvas.cpp b/src/gui/qgsmapcanvas.cpp index 5cb706ac17d..6d2b067ce2f 100644 --- a/src/gui/qgsmapcanvas.cpp +++ b/src/gui/qgsmapcanvas.cpp @@ -157,9 +157,9 @@ void QgsMapCanvas::enableAntiAliasing( bool theFlag ) mMapOverview->enableAntiAliasing( theFlag ); } // anti aliasing -void QgsMapCanvas::useQImageToRender( bool theFlag ) +void QgsMapCanvas::useImageToRender( bool theFlag ) { - mMap->useQImageToRender( theFlag ); + mMap->useImageToRender( theFlag ); } QgsMapCanvasMap* QgsMapCanvas::map() @@ -188,10 +188,10 @@ void QgsMapCanvas::setCurrentLayer( QgsMapLayer* layer ) mCurrentLayer = layer; } -double QgsMapCanvas::getScale() +double QgsMapCanvas::scale() { return mMapRenderer->scale(); -} // getScale +} // scale void QgsMapCanvas::setDirty( bool dirty ) { @@ -236,7 +236,7 @@ void QgsMapCanvas::setLayerSet( QList& layers ) { layerSet.push_back( lyr.layer()->getLayerID() ); } - if ( lyr.inOverview() ) + if ( lyr.isInOverview() ) { layerSetOverview.push_back( lyr.layer()->getLayerID() ); } @@ -467,7 +467,7 @@ void QgsMapCanvas::setExtent( QgsRect const & r ) mLastExtent = current; // notify canvas items of change - updateCanvasItemsPositions(); + updateCanvasItemPositions(); } // setExtent @@ -489,7 +489,7 @@ void QgsMapCanvas::clear() -void QgsMapCanvas::zoomFullExtent() +void QgsMapCanvas::zoomToFullExtent() { if ( mDrawing ) { @@ -506,11 +506,11 @@ void QgsMapCanvas::zoomFullExtent() } refresh(); -} // zoomFullExtent +} // zoomToFullExtent -void QgsMapCanvas::zoomPreviousExtent() +void QgsMapCanvas::zoomToPreviousExtent() { if ( mDrawing ) { @@ -521,7 +521,7 @@ void QgsMapCanvas::zoomPreviousExtent() setExtent( mLastExtent ); mLastExtent = current; refresh(); -} // zoomPreviousExtent +} // zoomToPreviousExtent bool QgsMapCanvas::projectionsEnabled() @@ -757,7 +757,7 @@ void QgsMapCanvas::mouseReleaseEvent( QMouseEvent * e ) if ( mMapTool ) { // right button was pressed in zoom tool? return to previous non zoom tool - if ( e->button() == Qt::RightButton && mMapTool->isZoomTool() ) + if ( e->button() == Qt::RightButton && mMapTool->isTransient() ) { QgsDebugMsg( "Right click in map tool zoom or pan, last tool is " + QString( mLastNonZoomMapTool ? "not null." : "null." ) ); @@ -816,7 +816,7 @@ void QgsMapCanvas::resizeEvent( QResizeEvent * e ) mScene->setSceneRect( QRectF( 0, 0, width, height ) ); // notify canvas items of change - updateCanvasItemsPositions(); + updateCanvasItemPositions(); updateScale(); refresh(); @@ -825,7 +825,7 @@ void QgsMapCanvas::resizeEvent( QResizeEvent * e ) } // resizeEvent -void QgsMapCanvas::updateCanvasItemsPositions() +void QgsMapCanvas::updateCanvasItemPositions() { QList list = mScene->items(); QList::iterator it = list.begin(); @@ -959,7 +959,7 @@ void QgsMapCanvas::setMapTool( QgsMapTool* tool ) if ( mMapTool ) mMapTool->deactivate(); - if ( tool->isZoomTool() && mMapTool && !mMapTool->isZoomTool() ) + if ( tool->isTransient() && mMapTool && !mMapTool->isTransient() ) { // if zoom or pan tool will be active, save old tool // to bring it back on right click @@ -1012,7 +1012,7 @@ void QgsMapCanvas::setCanvasColor( const QColor & theColor ) // background of QGraphicsScene mScene->setBackgroundBrush( bgBrush ); -} // setbgColor +} // setBackgroundColor QColor QgsMapCanvas::canvasColor() const { @@ -1200,7 +1200,7 @@ void QgsMapCanvas::moveCanvasContents( bool reset ) } // show items - updateCanvasItemsPositions(); + updateCanvasItemPositions(); } diff --git a/src/gui/qgsmapcanvas.h b/src/gui/qgsmapcanvas.h index 51ab97a2bec..a7da9746a53 100644 --- a/src/gui/qgsmapcanvas.h +++ b/src/gui/qgsmapcanvas.h @@ -63,14 +63,14 @@ class QgsMapTool; class GUI_EXPORT QgsMapCanvasLayer { public: - QgsMapCanvasLayer( QgsMapLayer* layer, bool visible = TRUE, bool inOverview = FALSE ) - : mLayer( layer ), mVisible( visible ), mInOverview( inOverview ) {} + QgsMapCanvasLayer( QgsMapLayer* layer, bool visible = TRUE, bool isInOverview = FALSE ) + : mLayer( layer ), mVisible( visible ), mInOverview( isInOverview ) {} void setVisible( bool visible ) { mVisible = visible; } - void setInOverview( bool inOverview ) { mInOverview = inOverview; } + void setInOverview( bool isInOverview ) { mInOverview = isInOverview; } bool isVisible() const { return mVisible; } - bool inOverview() const { return mInOverview; } + bool isInOverview() const { return mInOverview; } QgsMapLayer* layer() { return mLayer; } const QgsMapLayer* layer() const { return mLayer; } @@ -121,7 +121,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView QPixmap& canvasPixmap(); //! Get the last reported scale of the canvas - double getScale(); + double scale(); //! Clear the map canvas void clear(); @@ -138,10 +138,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView void setExtent( QgsRect const & r ); //! Zoom to the full extent of all layers - void zoomFullExtent(); + void zoomToFullExtent(); //! Zoom to the previous extent (view) - void zoomPreviousExtent(); + void zoomToPreviousExtent(); /**Zooms to the extend of the selected features*/ void zoomToSelected(); @@ -221,7 +221,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView void enableAntiAliasing( bool theFlag ); //! Select which Qt class to render with - void useQImageToRender( bool theFlag ); + void useImageToRender( bool theFlag ); // following 2 methods should be moved elsewhere or changed to private // currently used by pan map tool @@ -333,7 +333,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView void moveCanvasContents( bool reset = FALSE ); //! called on resize or changed extent to notify canvas items to change their rectangle - void updateCanvasItemsPositions(); + void updateCanvasItemPositions(); /// implementation struct class CanvasProperties; diff --git a/src/gui/qgsmapcanvasitem.cpp b/src/gui/qgsmapcanvasitem.cpp index d20f1c11253..3314652e42f 100644 --- a/src/gui/qgsmapcanvasitem.cpp +++ b/src/gui/qgsmapcanvasitem.cpp @@ -43,13 +43,13 @@ void QgsMapCanvasItem::paint( QPainter * painter, paint( painter ); // call the derived item's drawing routines } -QgsPoint QgsMapCanvasItem::toMapCoords( const QPoint& point ) +QgsPoint QgsMapCanvasItem::toMapCoordinates( const QPoint& point ) { return mMapCanvas->getCoordinateTransform()->toMapCoordinates( point - mPanningOffset ); } -QPointF QgsMapCanvasItem::toCanvasCoords( const QgsPoint& point ) +QPointF QgsMapCanvasItem::toCanvasCoordinates( const QgsPoint& point ) { double x = point.x(), y = point.y(); mMapCanvas->getCoordinateTransform()->transformInPlace( x, y ); @@ -71,8 +71,8 @@ void QgsMapCanvasItem::setRect( const QgsRect& rect ) QRectF r; // empty rect by default if ( !mRect.isEmpty() ) { - r.setTopLeft( toCanvasCoords( QgsPoint( mRect.xMin(), mRect.yMin() ) ) ); - r.setBottomRight( toCanvasCoords( QgsPoint( mRect.xMax(), mRect.yMax() ) ) ); + r.setTopLeft( toCanvasCoordinates( QgsPoint( mRect.xMin(), mRect.yMin() ) ) ); + r.setBottomRight( toCanvasCoordinates( QgsPoint( mRect.xMax(), mRect.yMax() ) ) ); r = r.normalized(); } diff --git a/src/gui/qgsmapcanvasitem.h b/src/gui/qgsmapcanvasitem.h index 9351af9b1f2..f717c24eeed 100644 --- a/src/gui/qgsmapcanvasitem.h +++ b/src/gui/qgsmapcanvasitem.h @@ -66,10 +66,10 @@ class GUI_EXPORT QgsMapCanvasItem : public QGraphicsItem void setRect( const QgsRect& r ); //! transformation from screen coordinates to map coordinates - QgsPoint toMapCoords( const QPoint& point ); + QgsPoint toMapCoordinates( const QPoint& point ); //! transformation from map coordinates to screen coordinates - QPointF toCanvasCoords( const QgsPoint& point ); + QPointF toCanvasCoordinates( const QgsPoint& point ); protected: diff --git a/src/gui/qgsmapcanvasmap.h b/src/gui/qgsmapcanvasmap.h index 33831f4a769..04cdfad63ed 100644 --- a/src/gui/qgsmapcanvasmap.h +++ b/src/gui/qgsmapcanvasmap.h @@ -39,7 +39,7 @@ class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; } - void useQImageToRender( bool flag ) { mUseQImageToRender = flag; } + void useImageToRender( bool flag ) { mUseQImageToRender = flag; } //! renders map using QgsMapRenderer to mPixmap void render(); diff --git a/src/gui/qgsmapoverviewcanvas.cpp b/src/gui/qgsmapoverviewcanvas.cpp index 89de6f0c392..53e8c6940ba 100644 --- a/src/gui/qgsmapoverviewcanvas.cpp +++ b/src/gui/qgsmapoverviewcanvas.cpp @@ -74,7 +74,7 @@ QgsMapOverviewCanvas::QgsMapOverviewCanvas( QWidget * parent, QgsMapCanvas* mapC mMapRenderer = new QgsMapRenderer; mMapRenderer->setOverview(); - setbgColor( palette().window().color() ); + setBackgroundColor( palette().window().color() ); } QgsMapOverviewCanvas::~QgsMapOverviewCanvas() @@ -251,7 +251,7 @@ void QgsMapOverviewCanvas::refresh() } -void QgsMapOverviewCanvas::setbgColor( const QColor& color ) +void QgsMapOverviewCanvas::setBackgroundColor( const QColor& color ) { mBgColor = color; diff --git a/src/gui/qgsmapoverviewcanvas.h b/src/gui/qgsmapoverviewcanvas.h index 35a22025f36..df7ab04228d 100644 --- a/src/gui/qgsmapoverviewcanvas.h +++ b/src/gui/qgsmapoverviewcanvas.h @@ -51,7 +51,7 @@ class GUI_EXPORT QgsMapOverviewCanvas : public QWidget void refresh(); //! changes background color - void setbgColor( const QColor& color ); + void setBackgroundColor( const QColor& color ); //! updates layer set for overview void setLayerSet( const QStringList& layerSet ); diff --git a/src/gui/qgsmaptool.cpp b/src/gui/qgsmaptool.cpp index bc668cfbffd..e83aebb662c 100644 --- a/src/gui/qgsmaptool.cpp +++ b/src/gui/qgsmaptool.cpp @@ -34,34 +34,34 @@ QgsMapTool::~QgsMapTool() } -QgsPoint QgsMapTool::toMapCoords( const QPoint& point ) +QgsPoint QgsMapTool::toMapCoordinates( const QPoint& point ) { return mCanvas->getCoordinateTransform()->toMapCoordinates( point ); } -QgsPoint QgsMapTool::toLayerCoords( QgsMapLayer* layer, const QPoint& point ) +QgsPoint QgsMapTool::toLayerCoordinates( QgsMapLayer* layer, const QPoint& point ) { - QgsPoint pt = toMapCoords( point ); - return toLayerCoords( layer, pt ); + QgsPoint pt = toMapCoordinates( point ); + return toLayerCoordinates( layer, pt ); } -QgsPoint QgsMapTool::toLayerCoords( QgsMapLayer* layer, const QgsPoint& point ) +QgsPoint QgsMapTool::toLayerCoordinates( QgsMapLayer* layer, const QgsPoint& point ) { return mCanvas->mapRenderer()->mapToLayerCoordinates( layer, point ); } -QgsPoint QgsMapTool::toMapCoords( QgsMapLayer* layer, const QgsPoint& point ) +QgsPoint QgsMapTool::toMapCoordinates( QgsMapLayer* layer, const QgsPoint& point ) { return mCanvas->mapRenderer()->layerToMapCoordinates( layer, point ); } -QgsRect QgsMapTool::toLayerCoords( QgsMapLayer* layer, const QgsRect& rect ) +QgsRect QgsMapTool::toLayerCoordinates( QgsMapLayer* layer, const QgsRect& rect ) { return mCanvas->mapRenderer()->mapToLayerCoordinates( layer, rect ); } -QPoint QgsMapTool::toCanvasCoords( const QgsPoint& point ) +QPoint QgsMapTool::toCanvasCoordinates( const QgsPoint& point ) { double x = point.x(), y = point.y(); mCanvas->getCoordinateTransform()->transformInPlace( x, y ); @@ -136,7 +136,7 @@ void QgsMapTool::renderComplete() { } -bool QgsMapTool::isZoomTool() +bool QgsMapTool::isTransient() { return false; } diff --git a/src/gui/qgsmaptool.h b/src/gui/qgsmaptool.h index f8555a45c58..2ad3e52f2e6 100644 --- a/src/gui/qgsmaptool.h +++ b/src/gui/qgsmaptool.h @@ -83,7 +83,7 @@ class GUI_EXPORT QgsMapTool : public QObject /** Check whether this MapTool performs a zoom or pan operation. * If it does, we will be able to perform the zoom and then * resume operations with the original / previously used tool.*/ - virtual bool isZoomTool(); + virtual bool isTransient(); /** Check whether this MapTool performs an edit operation. * If it does, we will deactivate it when editing is turned off @@ -105,22 +105,22 @@ class GUI_EXPORT QgsMapTool : public QObject QgsMapTool( QgsMapCanvas* canvas ); //! transformation from screen coordinates to map coordinates - QgsPoint toMapCoords( const QPoint& point ); + QgsPoint toMapCoordinates( const QPoint& point ); //! transformation from screen coordinates to layer's coordinates - QgsPoint toLayerCoords( QgsMapLayer* layer, const QPoint& point ); + QgsPoint toLayerCoordinates( QgsMapLayer* layer, const QPoint& point ); //! trasformation from map coordinates to layer's coordinates - QgsPoint toLayerCoords( QgsMapLayer* layer, const QgsPoint& point ); + QgsPoint toLayerCoordinates( QgsMapLayer* layer, const QgsPoint& point ); //!transformation from layer's coordinates to map coordinates (which is different in case reprojection is used) - QgsPoint toMapCoords( QgsMapLayer* layer, const QgsPoint& point ); + QgsPoint toMapCoordinates( QgsMapLayer* layer, const QgsPoint& point ); //! trnasformation of the rect from map coordinates to layer's coordinates - QgsRect toLayerCoords( QgsMapLayer* layer, const QgsRect& rect ); + QgsRect toLayerCoordinates( QgsMapLayer* layer, const QgsRect& rect ); //! transformation from map coordinates to screen coordinates - QPoint toCanvasCoords( const QgsPoint& point ); + QPoint toCanvasCoordinates( const QgsPoint& point ); //! pointer to map canvas QgsMapCanvas* mCanvas; diff --git a/src/gui/qgsmaptoolemitpoint.cpp b/src/gui/qgsmaptoolemitpoint.cpp index 651accc123c..cca2377dcad 100644 --- a/src/gui/qgsmaptoolemitpoint.cpp +++ b/src/gui/qgsmaptoolemitpoint.cpp @@ -31,7 +31,7 @@ void QgsMapToolEmitPoint::canvasMoveEvent( QMouseEvent * e ) void QgsMapToolEmitPoint::canvasPressEvent( QMouseEvent * e ) { - QgsPoint pnt = toMapCoords( e->pos() ); + QgsPoint pnt = toMapCoordinates( e->pos() ); emit gotPoint( pnt, e->button() ); } diff --git a/src/gui/qgsmaptoolpan.h b/src/gui/qgsmaptoolpan.h index 272530f149b..4e569bd2167 100644 --- a/src/gui/qgsmaptoolpan.h +++ b/src/gui/qgsmaptoolpan.h @@ -40,7 +40,7 @@ class GUI_EXPORT QgsMapToolPan : public QgsMapTool //! Overridden mouse release event virtual void canvasReleaseEvent( QMouseEvent * e ); - virtual bool isZoomTool() { return true; } + virtual bool isTransient() { return true; } private: diff --git a/src/gui/qgsmaptoolzoom.h b/src/gui/qgsmaptoolzoom.h index 2a8d54911f2..51f1fdea323 100644 --- a/src/gui/qgsmaptoolzoom.h +++ b/src/gui/qgsmaptoolzoom.h @@ -42,7 +42,7 @@ class GUI_EXPORT QgsMapToolZoom : public QgsMapTool //! Overridden mouse release event virtual void canvasReleaseEvent( QMouseEvent * e ); - virtual bool isZoomTool() { return true; } + virtual bool isTransient() { return true; } protected: //! stores actual zoom rect diff --git a/src/gui/qgsrubberband.cpp b/src/gui/qgsrubberband.cpp index ff8a56cdb7e..0aaf90d773f 100644 --- a/src/gui/qgsrubberband.cpp +++ b/src/gui/qgsrubberband.cpp @@ -294,7 +294,7 @@ void QgsRubberBand::paint( QPainter* p ) for ( ; it != mPoints.at( i ).constEnd(); ++it ) { //QgsDebugMsg("Drawing rubberband vertex: " + QString::number(it->x() + mTranslationOffsetX) + "//" + QString::number(it->y() + mTranslationOffsetY)); - pts.append( toCanvasCoords( QgsPoint( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY ) ) - pos() ); + pts.append( toCanvasCoordinates( QgsPoint( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY ) ) - pos() ); } if ( mIsPolygon ) diff --git a/src/gui/qgsvertexmarker.cpp b/src/gui/qgsvertexmarker.cpp index 7b631cc30f1..8f4b0ec8bce 100644 --- a/src/gui/qgsvertexmarker.cpp +++ b/src/gui/qgsvertexmarker.cpp @@ -41,7 +41,7 @@ void QgsVertexMarker::setIconSize( int iconSize ) void QgsVertexMarker::setCenter( const QgsPoint& point ) { mCenter = point; - QPointF pt = toCanvasCoords( mCenter ); + QPointF pt = toCanvasCoordinates( mCenter ); setPos( pt ); } diff --git a/src/plugins/georeferencer/qgsgeorefdatapoint.cpp b/src/plugins/georeferencer/qgsgeorefdatapoint.cpp index 8d8eeb5cb0d..90aa335503a 100644 --- a/src/plugins/georeferencer/qgsgeorefdatapoint.cpp +++ b/src/plugins/georeferencer/qgsgeorefdatapoint.cpp @@ -48,5 +48,5 @@ QRectF QgsGeorefDataPoint::boundingRect() const void QgsGeorefDataPoint::updatePosition() { - setPos( toCanvasCoords( mPixelCoords ) ); + setPos( toCanvasCoordinates( mPixelCoords ) ); } diff --git a/src/plugins/georeferencer/qgspointdialog.cpp b/src/plugins/georeferencer/qgspointdialog.cpp index e427fd077ea..a1dabb2b8ea 100644 --- a/src/plugins/georeferencer/qgspointdialog.cpp +++ b/src/plugins/georeferencer/qgspointdialog.cpp @@ -47,7 +47,7 @@ class QgsGeorefTool : public QgsMapTool //! Mouse press event for overriding virtual void canvasPressEvent( QMouseEvent * e ) { - QgsPoint pnt = toMapCoords( e->pos() ); + QgsPoint pnt = toMapCoordinates( e->pos() ); if ( mAddPoint ) mDlg->showCoordDialog( pnt ); diff --git a/src/plugins/grass/qgsgrassedittools.cpp b/src/plugins/grass/qgsgrassedittools.cpp index aa9bde541c6..029655a1431 100644 --- a/src/plugins/grass/qgsgrassedittools.cpp +++ b/src/plugins/grass/qgsgrassedittools.cpp @@ -40,7 +40,7 @@ QgsGrassEditTool::QgsGrassEditTool( QgsGrassEdit* edit ) void QgsGrassEditTool::canvasPressEvent( QMouseEvent * event ) { - QgsPoint point = toLayerCoords( e->layer(), event->pos() ); + QgsPoint point = toLayerCoordinates( e->layer(), event->pos() ); mouseClick( point, event->button() ); // Set last click @@ -53,7 +53,7 @@ void QgsGrassEditTool::canvasPressEvent( QMouseEvent * event ) void QgsGrassEditTool::canvasMoveEvent( QMouseEvent * event ) { - QgsPoint point = toLayerCoords( e->layer(), event->pos() ); + QgsPoint point = toLayerCoordinates( e->layer(), event->pos() ); mouseMove( point ); e->statusBar()->message( e->mCanvasPrompt ); @@ -147,7 +147,7 @@ void QgsGrassEditNewLine::activate() { Vect_reset_line( e->mPoints ); Vect_append_points( e->mPoints, e->mEditPoints, GV_FORWARD ); - QgsPoint point = toMapCoords( e->mCanvas->mouseLastXY() ); + QgsPoint point = toMapCoordinates( e->mCanvas->mouseLastXY() ); Vect_append_point( e->mPoints, point.x(), point.y(), 0.0 ); e->displayDynamic( e->mPoints ); } @@ -181,7 +181,7 @@ void QgsGrassEditNewLine::mouseClick( QgsPoint & point, Qt::ButtonState button ) e->mEditPoints->n_points--; Vect_reset_line( e->mPoints ); Vect_append_points( e->mPoints, e->mEditPoints, GV_FORWARD ); - QgsPoint point = toMapCoords( e->mCanvas->mouseLastXY() ); + QgsPoint point = toMapCoordinates( e->mCanvas->mouseLastXY() ); Vect_append_point( e->mPoints, point.x(), point.y(), 0.0 ); e->displayDynamic( e->mPoints ); } diff --git a/src/plugins/grass/qgsgrassregion.cpp b/src/plugins/grass/qgsgrassregion.cpp index c30dc3d4625..1bb2172fcb4 100644 --- a/src/plugins/grass/qgsgrassregion.cpp +++ b/src/plugins/grass/qgsgrassregion.cpp @@ -81,7 +81,7 @@ class QgsGrassRegionEdit : public QgsMapTool //! mouse click in map canvas void canvasPressEvent( QMouseEvent * event ) { - QgsPoint point = toMapCoords( event->pos() ); + QgsPoint point = toMapCoordinates( event->pos() ); double x = point.x(); double y = point.y(); @@ -106,7 +106,7 @@ class QgsGrassRegionEdit : public QgsMapTool //! mouse movement in map canvas void canvasMoveEvent( QMouseEvent * event ) { - QgsPoint point = toMapCoords( event->pos() ); + QgsPoint point = toMapCoordinates( event->pos() ); QgsDebugMsg( "entered." ); @@ -124,8 +124,8 @@ class QgsGrassRegionEdit : public QgsMapTool void setRegion( const QgsPoint& ul, const QgsPoint& lr ) { - QPoint qul = toCanvasCoords( ul ); - QPoint qlr = toCanvasCoords( lr ); + QPoint qul = toCanvasCoordinates( ul ); + QPoint qlr = toCanvasCoordinates( lr ); mRubberBand->setGeometry( QRect( qul, qlr ) ); } diff --git a/src/plugins/maplayer/maplayertest.cpp b/src/plugins/maplayer/maplayertest.cpp index e5337867601..a4abdc47a4f 100644 --- a/src/plugins/maplayer/maplayertest.cpp +++ b/src/plugins/maplayer/maplayertest.cpp @@ -43,8 +43,8 @@ void MapLayerTest::initGui() menuId = menu->insertItem( "&PluginMenu", mapLayerPluginMenu ); #if 0 - QAction *zoomPreviousAction = new QAction( "Zoom Previous", QIconSet( icon_matrix ), "&Zoom Previous", CTRL + Key_S, qgisMainWindow, "zoomFull" ); - connect( zoomPreviousAction, SIGNAL( triggered() ), this, SLOT( zoomPrevious() ) ); + QAction *zoomToPreviousAction = new QAction( "Zoom Previous", QIconSet( icon_matrix ), "&Zoom Previous", CTRL + Key_S, qgisMainWindow, "zoomFull" ); + connect( zoomToPreviousAction, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) ); #endif } void MapLayerTest::unload()