Skip to content

Commit 8f60bc5

Browse files
author
timlinux
committed
More api cleanups mainly affecting gui
git-svn-id: http://svn.osgeo.org/qgis/trunk@9233 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 21a5d72 commit 8f60bc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+134
-134
lines changed

python/gui/qgisinterface.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class QgisInterface : QObject
3131
//! Zoom to full extent of map layers
3232
virtual void zoomFull()=0;
3333
//! Zoom to previous view extent
34-
virtual void zoomPrevious()=0;
34+
virtual void zoomToPrevious()=0;
3535
//! Zoome to extent of the active layer
3636
virtual void zoomActiveLayer()=0;
3737

python/gui/qgsmapcanvas.sip

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class QgsMapCanvasLayer
1111
%End
1212

1313
public:
14-
QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool inOverview = FALSE);
14+
QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool isInOverview = FALSE);
1515

1616
void setVisible(bool visible);
17-
void setInOverview(bool inOverview);
17+
void setInOverview(bool isInOverview);
1818

1919
bool isVisible() const;
20-
bool inOverview() const;
20+
bool isInOverview() const;
2121

2222
QgsMapLayer* layer();
2323
//const QgsMapLayer* layer() const;
@@ -68,7 +68,7 @@ class QgsMapCanvas : QGraphicsView
6868
QPixmap& canvasPixmap();
6969

7070
//! Get the last reported scale of the canvas
71-
double getScale();
71+
double scale();
7272

7373
//! Clear the map canvas
7474
void clear();
@@ -85,10 +85,10 @@ class QgsMapCanvas : QGraphicsView
8585
void setExtent(const QgsRect & r);
8686

8787
//! Zoom to the full extent of all layers
88-
void zoomFullExtent();
88+
void zoomToFullExtent();
8989

9090
//! Zoom to the previous extent (view)
91-
void zoomPreviousExtent();
91+
void zoomToPreviousExtent();
9292

9393
/**Zooms to the extend of the selected features*/
9494
void zoomToSelected();
@@ -165,7 +165,7 @@ class QgsMapCanvas : QGraphicsView
165165
void enableAntiAliasing(bool theFlag);
166166

167167
//! Select which Qt class to render with
168-
void useQImageToRender(bool theFlag);
168+
void useImageToRender(bool theFlag);
169169

170170
// following 2 methods should be moved elsewhere or changed to private
171171
// currently used by pan map tool
@@ -272,7 +272,7 @@ class QgsMapCanvas : QGraphicsView
272272
void moveCanvasContents(bool reset = FALSE);
273273

274274
//! called on resize or changed extent to notify canvas items to change their rectangle
275-
void updateCanvasItemsPositions();
275+
void updateCanvasItemPositions();
276276

277277

278278
}; // class QgsMapCanvas

python/gui/qgsmapcanvasitem.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class QgsMapCanvasItem : QGraphicsItem
4242
void setRect(const QgsRect& r);
4343

4444
//! transformation from screen coordinates to map coordinates
45-
QgsPoint toMapCoords(const QPoint& point);
45+
QgsPoint toMapCoordinates(const QPoint& point);
4646

4747
//! transformation from map coordinates to screen coordinates
48-
QPointF toCanvasCoords(const QgsPoint& point);
48+
QPointF toCanvasCoordinates(const QgsPoint& point);
4949

5050
};
5151

python/gui/qgsmapcanvasmap.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class QgsMapCanvasMap : QGraphicsRectItem
3333

3434
void enableAntiAliasing(bool flag);
3535

36-
void useQImageToRender(bool flag);
36+
void useImageToRender(bool flag);
3737

3838
//! renders map using QgsMapRender to mPixmap
3939
void render();

python/gui/qgsmapoverviewcanvas.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class QgsMapOverviewCanvas : QWidget
1717
void refresh();
1818

1919
//! changes background color
20-
void setbgColor(const QColor& color);
20+
void setBackgroundColor(const QColor& color);
2121

2222
//! updates layer set for overview
2323
void setLayerSet(const QStringList& layerSet);

python/gui/qgsmaptool.sip

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class QgsMapTool : QObject
5757
/** Check whether this MapTool performs a zoom or pan operation.
5858
* If it does, we will be able to perform the zoom and then
5959
* resume operations with the original / previously used tool.*/
60-
virtual bool isZoomTool();
60+
virtual bool isTransient();
6161

6262
/** Check whether this MapTool performs an edit operation.
6363
* If it does, we will deactivate it when editing is turned off
@@ -76,19 +76,19 @@ class QgsMapTool : QObject
7676
QgsMapTool(QgsMapCanvas* canvas /TransferThis/);
7777

7878
//! transformation from screen coordinates to map coordinates
79-
QgsPoint toMapCoords(const QPoint& point);
79+
QgsPoint toMapCoordinates(const QPoint& point);
8080

8181
//! transformation from screen coordinates to layer's coordinates
82-
QgsPoint toLayerCoords(QgsMapLayer* layer, const QPoint& point);
82+
QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QPoint& point);
8383

8484
//! trnasformation from map coordinates to layer's coordinates
85-
QgsPoint toLayerCoords(QgsMapLayer* layer, const QgsPoint& point);
85+
QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QgsPoint& point);
8686

8787
//! trnasformation of the rect from map coordinates to layer's coordinates
88-
QgsRect toLayerCoords(QgsMapLayer* layer, const QgsRect& rect);
88+
QgsRect toLayerCoordinates(QgsMapLayer* layer, const QgsRect& rect);
8989

9090
//! transformation from map coordinates to screen coordinates
91-
QPoint toCanvasCoords(const QgsPoint& point);
91+
QPoint toCanvasCoordinates(const QgsPoint& point);
9292

9393

9494
};

python/gui/qgsmaptoolpan.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class QgsMapToolPan : QgsMapTool
1818
//! Overridden mouse release event
1919
virtual void canvasReleaseEvent(QMouseEvent * e);
2020

21-
virtual bool isZoomTool();
21+
virtual bool isTransient();
2222

2323
};
2424

python/gui/qgsmaptoolzoom.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class QgsMapToolZoom : QgsMapTool
1818
//! Overridden mouse release event
1919
virtual void canvasReleaseEvent(QMouseEvent * e);
2020

21-
virtual bool isZoomTool();
21+
virtual bool isTransient();
2222

2323
};
2424

src/app/legend/qgslegend.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
511511

512512
// first layer?
513513
if ( mMapCanvas->layerCount() == 1 )
514-
mMapCanvas->zoomFullExtent();
514+
mMapCanvas->zoomToFullExtent();
515515
setCurrentItem( llayer );
516516
//make the QTreeWidget item up-to-date
517517
doItemsLayout();
@@ -910,7 +910,7 @@ bool QgsLegend::writeXML( QDomNode & legendnode, QDomDocument & document )
910910
legendlayerfilenode.setAttribute( "visible", llf->isVisible() );
911911

912912
// show in overview flag
913-
legendlayerfilenode.setAttribute( "inOverview", llf->isInOverview() );
913+
legendlayerfilenode.setAttribute( "isInOverview", llf->isInOverview() );
914914
}
915915
break;
916916

@@ -1035,7 +1035,7 @@ bool QgsLegend::readXML( QDomNode& legendnode )
10351035

10361036
// load layer's visibility and 'show in overview' flag
10371037
theLegendLayerFile->setVisible( atoi( childelem.attribute( "visible", "1" ).toUtf8() ) ); //Default is visible
1038-
theLegendLayerFile->setInOverview( atoi( childelem.attribute( "inOverview" ).toUtf8() ) );
1038+
theLegendLayerFile->setInOverview( atoi( childelem.attribute( "isInOverview" ).toUtf8() ) );
10391039

10401040
// set the check state
10411041
blockSignals( true );
@@ -1399,15 +1399,15 @@ void QgsLegend::updateOverview()
13991399
mMapCanvas->updateOverview();
14001400
}
14011401

1402-
void QgsLegend::setOverviewAllLayers( bool inOverview )
1402+
void QgsLegend::setOverviewAllLayers( bool isInOverview )
14031403
{
14041404
QTreeWidgetItem* theItem = firstItem();
14051405
while ( theItem )
14061406
{
14071407
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>( theItem );
14081408
if ( llf )
14091409
{
1410-
llf->setInOverview( inOverview );
1410+
llf->setInOverview( isInOverview );
14111411
}
14121412
theItem = nextItem( theItem );
14131413
}

src/app/legend/qgslegend.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class QgsLegend : public QTreeWidget
154154
void updateOverview();
155155

156156
/**Show/remove all layer in/from overview*/
157-
void setOverviewAllLayers( bool inOverview );
157+
void setOverviewAllLayers( bool isInOverview );
158158

159159
/**Adds an entry to mPixmapWidthValues*/
160160
void addPixmapWidthValue( int width );

src/app/legend/qgslegendlayerfile.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void QgsLegendLayerFile::updateLegendItem()
102102
{
103103
QPixmap pix = legend()->pixmaps().mOriginalPixmap;
104104

105-
if ( mLyr.inOverview() )
105+
if ( mLyr.isInOverview() )
106106
{
107107
//add overview glasses to the pixmap
108108
QPainter p( &pix );
@@ -130,12 +130,12 @@ void QgsLegendLayerFile::updateLegendItem()
130130

131131
}
132132

133-
void QgsLegendLayerFile::setIconAppearance( bool inOverview,
133+
void QgsLegendLayerFile::setIconAppearance( bool isInOverview,
134134
bool editable )
135135
{
136136
QPixmap newIcon( getOriginalPixmap() );
137137

138-
if ( inOverview )
138+
if ( isInOverview )
139139
{
140140
// Overlay the overview icon on the default icon
141141
QPixmap myPixmap = QgisApp::getThemePixmap( "mIconOverview.png" );
@@ -189,14 +189,14 @@ bool QgsLegendLayerFile::isVisible()
189189
return mLyr.isVisible();
190190
}
191191

192-
void QgsLegendLayerFile::setInOverview( bool inOverview )
192+
void QgsLegendLayerFile::setInOverview( bool isInOverview )
193193
{
194-
mLyr.setInOverview( inOverview );
194+
mLyr.setInOverview( isInOverview );
195195
}
196196

197197
bool QgsLegendLayerFile::isInOverview()
198198
{
199-
return mLyr.inOverview();
199+
return mLyr.isInOverview();
200200
}
201201

202202
void QgsLegendLayerFile::showInOverview()
@@ -333,7 +333,7 @@ void QgsLegendLayerFile::addToPopupMenu( QMenu& theMenu, QAction* toggleEditingA
333333
QAction* showInOverviewAction = theMenu.addAction( tr( "&Show in overview" ), this, SLOT( showInOverview() ) );
334334
showInOverviewAction->setCheckable( true );
335335
showInOverviewAction->blockSignals( true );
336-
showInOverviewAction->setChecked( mLyr.inOverview() );
336+
showInOverviewAction->setChecked( mLyr.isInOverview() );
337337
showInOverviewAction->blockSignals( false );
338338

339339
// remove from canvas

src/app/legend/qgslegendlayerfile.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class QgsLegendLayerFile : public QgsLegendItem
4646

4747
QPixmap getOriginalPixmap() const;
4848

49-
void setIconAppearance( bool inOverview, bool editable );
49+
void setIconAppearance( bool isInOverview, bool editable );
5050

5151
/**Returns a label for a layer. Is static such that
5252
the name can be passed to the constructor of QgsLegendLayerFile*/
@@ -55,7 +55,7 @@ class QgsLegendLayerFile : public QgsLegendItem
5555
void setVisible( bool visible = TRUE );
5656
bool isVisible();
5757

58-
void setInOverview( bool inOverview = TRUE );
58+
void setInOverview( bool isInOverview = TRUE );
5959
bool isInOverview();
6060

6161
/** called to add appropriate menu items to legend's popup menu */

src/app/qgisapp.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ void QgisApp::createActions()
728728
mActionZoomLast = new QAction( getThemeIcon( "mActionZoomLast.png" ), tr( "Zoom Last" ), this );
729729
//mActionZoomLast->setShortcut(tr("Ctrl+O","Zoom to Last Extent"));
730730
mActionZoomLast->setStatusTip( tr( "Zoom to Last Extent" ) );
731-
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomPrevious() ) );
731+
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) );
732732

733733
mActionZoomActualSize = new QAction( tr( "Zoom Actual Size" ), this );
734734
mActionZoomActualSize->setStatusTip( tr( "Zoom to Actual Size" ) );
@@ -825,7 +825,7 @@ void QgisApp::createActions()
825825
mActionAddToOverview = new QAction( getThemeIcon( "mActionInOverview.png" ), tr( "Add to Overview" ), this );
826826
mActionAddToOverview->setShortcut( tr( "O", "Add current layer to overview map" ) );
827827
mActionAddToOverview->setStatusTip( tr( "Add current layer to overview map" ) );
828-
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( inOverview() ) );
828+
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( isInOverview() ) );
829829
mActionAddToOverview->setEnabled( false );
830830

831831
mActionAddAllToOverview = new QAction( getThemeIcon( "mActionAddAllToOverview.png" ), tr( "Add All to Overview" ), this );
@@ -1596,7 +1596,7 @@ void QgisApp::createOverview()
15961596
// moved here to set anti aliasing to both map canvas and overview
15971597
QSettings mySettings;
15981598
mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing", false ).toBool() );
1599-
mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() );
1599+
mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() );
16001600

16011601
int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt();
16021602
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();
@@ -3650,15 +3650,15 @@ void QgisApp::pan()
36503650

36513651
void QgisApp::zoomFull()
36523652
{
3653-
mMapCanvas->zoomFullExtent();
3653+
mMapCanvas->zoomToFullExtent();
36543654
// notify the project we've made a change
36553655
QgsProject::instance()->dirty( true );
36563656

36573657
}
36583658

3659-
void QgisApp::zoomPrevious()
3659+
void QgisApp::zoomToPrevious()
36603660
{
3661-
mMapCanvas->zoomPreviousExtent();
3661+
mMapCanvas->zoomToPreviousExtent();
36623662
// notify the project we've made a change
36633663
QgsProject::instance()->dirty( true );
36643664

@@ -4078,7 +4078,7 @@ void QgisApp::showScale( double theScale )
40784078

40794079
void QgisApp::userScale()
40804080
{
4081-
double currentScale = mMapCanvas->getScale();
4081+
double currentScale = mMapCanvas->scale();
40824082

40834083
QStringList parts = mScaleEdit->text().split( ':' );
40844084
if ( parts.size() == 2 )
@@ -4096,7 +4096,7 @@ void QgisApp::userScale()
40964096

40974097

40984098
// toggle overview status
4099-
void QgisApp::inOverview()
4099+
void QgisApp::isInOverview()
41004100
{
41014101
mMapLegend->legendLayerShowInOverview();
41024102
}
@@ -4477,7 +4477,7 @@ void QgisApp::options()
44774477

44784478
QSettings mySettings;
44794479
mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing" ).toBool() );
4480-
mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() );
4480+
mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() );
44814481

44824482
int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt();
44834483
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();

src/app/qgisapp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class QgisApp : public QMainWindow
312312
//! Zoom to full extent
313313
void zoomFull();
314314
//! Zoom to the previous extent
315-
void zoomPrevious();
315+
void zoomToPrevious();
316316
//! Zoom to selected features
317317
void zoomToSelected();
318318

@@ -358,7 +358,7 @@ class QgisApp : public QMainWindow
358358
void addDatabaseLayer();
359359
//#endif
360360
/** toggles whether the current selected layer is in overview or not */
361-
void inOverview();
361+
void isInOverview();
362362
//! Slot to show the map coordinate position of the mouse cursor
363363
void showMouseCoordinate( QgsPoint & );
364364
//! Slot to show current map scale;

src/app/qgisappinterface.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ void QgisAppInterface::zoomFull()
4747
qgis->zoomFull();
4848
}
4949

50-
void QgisAppInterface::zoomPrevious()
50+
void QgisAppInterface::zoomToPrevious()
5151
{
52-
qgis->zoomPrevious();
52+
qgis->zoomToPrevious();
5353
}
5454

5555
void QgisAppInterface::zoomActiveLayer()

src/app/qgisappinterface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class QgisAppInterface : public QgisInterface
4646
//! Zoom map to full extent
4747
void zoomFull();
4848
//! Zoom map to previous extent
49-
void zoomPrevious();
49+
void zoomToPrevious();
5050
//! Zoom to active layer
5151
void zoomActiveLayer();
5252

src/app/qgsmaptooladdfeature.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
103103
idPoint = snapPointFromResults( snapResults, e->pos() );
104104
try
105105
{
106-
savePoint = toLayerCoords( vlayer, idPoint );
106+
savePoint = toLayerCoordinates( vlayer, idPoint );
107107
QgsDebugMsg( "savePoint = " + savePoint.toString() );
108108
}
109109
catch ( QgsCsException &cse )

0 commit comments

Comments
 (0)