@@ -1787,23 +1787,23 @@ void QgisApp::createActions()
1787
1787
connect( mActionCopyStyle, &QAction::triggered, this, [ = ] { copyStyle(); } );
1788
1788
connect( mActionPasteStyle, &QAction::triggered, this, [ = ] { pasteStyle(); } );
1789
1789
connect( mActionAddFeature, &QAction::triggered, this, &QgisApp::addFeature );
1790
- connect( mActionCircularStringCurvePoint, &QAction::triggered, this, &QgisApp::circularStringCurvePoint );
1791
- connect( mActionCircularStringRadius, &QAction::triggered, this, &QgisApp::circularStringRadius );
1792
- connect( mActionCircle2Points, &QAction::triggered, this, &QgisApp::circle2Points );
1793
- connect( mActionCircle3Points, &QAction::triggered, this, &QgisApp::circle3Points );
1794
- connect( mActionCircle3Tangents, &QAction::triggered, this, &QgisApp::circle3Tangents );
1795
- connect( mActionCircle2TangentsPoint, &QAction::triggered, this, &QgisApp::circle2TangentsPoint );
1796
- connect( mActionCircleCenterPoint, &QAction::triggered, this, &QgisApp::circleCenterPoint );
1797
- connect( mActionEllipseCenter2Points, &QAction::triggered, this, &QgisApp::ellipseCenter2Points );
1798
- connect( mActionEllipseCenterPoint, &QAction::triggered, this, &QgisApp::ellipseCenterPoint );
1799
- connect( mActionEllipseExtent, &QAction::triggered, this, &QgisApp::ellipseExtent );
1800
- connect( mActionEllipseFoci, &QAction::triggered, this, &QgisApp::ellipseFoci );
1801
- connect( mActionRectangleCenterPoint, &QAction::triggered, this, &QgisApp::rectangleCenterPoint );
1802
- connect( mActionRectangleExtent, &QAction::triggered, this, &QgisApp::rectangleExtent );
1803
- connect( mActionRectangle3Points, &QAction::triggered, this, &QgisApp::rectangle3Points );
1804
- connect( mActionRegularPolygon2Points, &QAction::triggered, this, &QgisApp::regularPolygon2Points );
1805
- connect( mActionRegularPolygonCenterPoint, &QAction::triggered, this, &QgisApp::regularPolygonCenterPoint );
1806
- connect( mActionRegularPolygonCenterCorner, &QAction::triggered, this, &QgisApp::regularPolygonCenterCorner );
1790
+ connect( mActionCircularStringCurvePoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircularStringRadius ); } );
1791
+ connect( mActionCircularStringRadius, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircularStringRadius ); } );
1792
+ connect( mActionCircle2Points, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircle2Points ); } );
1793
+ connect( mActionCircle3Points, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircle3Points ); } );
1794
+ connect( mActionCircle3Tangents, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircle3Tangents ); } );
1795
+ connect( mActionCircle2TangentsPoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircle2TangentsPoint ); } );
1796
+ connect( mActionCircleCenterPoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mCircleCenterPoint ); } );
1797
+ connect( mActionEllipseCenter2Points, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mEllipseCenter2Points ); } );
1798
+ connect( mActionEllipseCenterPoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mEllipseCenterPoint ); } );
1799
+ connect( mActionEllipseExtent, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mEllipseExtent ); } );
1800
+ connect( mActionEllipseFoci, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mEllipseFoci ); } );
1801
+ connect( mActionRectangleCenterPoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mRectangleCenterPoint ); } );
1802
+ connect( mActionRectangleExtent, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mRectangleExtent ); } );
1803
+ connect( mActionRectangle3Points, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mRectangle3Points ); } );
1804
+ connect( mActionRegularPolygon2Points, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mRegularPolygon2Points ); } );
1805
+ connect( mActionRegularPolygonCenterPoint, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mRegularPolygonCenterPoint ); } );
1806
+ connect( mActionRegularPolygonCenterCorner, &QAction::triggered, this, [ = ] { setMapTool( mMapTools.mRegularPolygonCenterCorner ); } );
1807
1807
connect( mActionMoveFeature, &QAction::triggered, this, &QgisApp::moveFeature );
1808
1808
connect( mActionMoveFeature, &QAction::triggered, this, &QgisApp::moveFeature );
1809
1809
connect( mActionMoveFeatureCopy, &QAction::triggered, this, &QgisApp::moveFeatureCopy );
@@ -7801,89 +7801,9 @@ void QgisApp::addFeature()
7801
7801
mMapCanvas->setMapTool( mMapTools.mAddFeature );
7802
7802
}
7803
7803
7804
- void QgisApp::circularStringCurvePoint( )
7804
+ void QgisApp::setMapTool( QgsMapTool *tool )
7805
7805
{
7806
- mMapCanvas->setMapTool( mMapTools.mCircularStringCurvePoint );
7807
- }
7808
-
7809
- void QgisApp::circularStringRadius()
7810
- {
7811
- mMapCanvas->setMapTool( mMapTools.mCircularStringRadius );
7812
- }
7813
-
7814
- void QgisApp::circle2Points()
7815
- {
7816
- mMapCanvas->setMapTool( mMapTools.mCircle2Points );
7817
- }
7818
-
7819
- void QgisApp::circle3Points()
7820
- {
7821
- mMapCanvas->setMapTool( mMapTools.mCircle3Points );
7822
- }
7823
-
7824
- void QgisApp::circle3Tangents()
7825
- {
7826
- mMapCanvas->setMapTool( mMapTools.mCircle3Tangents );
7827
- }
7828
-
7829
- void QgisApp::circle2TangentsPoint()
7830
- {
7831
- mMapCanvas->setMapTool( mMapTools.mCircle2TangentsPoint );
7832
- }
7833
-
7834
- void QgisApp::circleCenterPoint()
7835
- {
7836
- mMapCanvas->setMapTool( mMapTools.mCircleCenterPoint );
7837
- }
7838
-
7839
- void QgisApp::ellipseCenter2Points()
7840
- {
7841
- mMapCanvas->setMapTool( mMapTools.mEllipseCenter2Points );
7842
- }
7843
-
7844
- void QgisApp::ellipseCenterPoint()
7845
- {
7846
- mMapCanvas->setMapTool( mMapTools.mEllipseCenterPoint );
7847
- }
7848
-
7849
- void QgisApp::ellipseExtent()
7850
- {
7851
- mMapCanvas->setMapTool( mMapTools.mEllipseExtent );
7852
- }
7853
-
7854
- void QgisApp::ellipseFoci()
7855
- {
7856
- mMapCanvas->setMapTool( mMapTools.mEllipseFoci );
7857
- }
7858
-
7859
- void QgisApp::rectangleCenterPoint()
7860
- {
7861
- mMapCanvas->setMapTool( mMapTools.mRectangleCenterPoint );
7862
- }
7863
-
7864
- void QgisApp::rectangleExtent()
7865
- {
7866
- mMapCanvas->setMapTool( mMapTools.mRectangleExtent );
7867
- }
7868
-
7869
- void QgisApp::rectangle3Points()
7870
- {
7871
- mMapCanvas->setMapTool( mMapTools.mRectangle3Points );
7872
- }
7873
-
7874
- void QgisApp::regularPolygon2Points()
7875
- {
7876
- mMapCanvas->setMapTool( mMapTools.mRegularPolygon2Points );
7877
- }
7878
-
7879
- void QgisApp::regularPolygonCenterPoint()
7880
- {
7881
- mMapCanvas->setMapTool( mMapTools.mRegularPolygonCenterPoint );
7882
- }
7883
-
7884
- void QgisApp::regularPolygonCenterCorner()
7885
- {
7886
- mMapCanvas->setMapTool( mMapTools.mRegularPolygonCenterCorner );
7806
+ mMapCanvas->setMapTool( tool );
7887
7807
}
7888
7808
7889
7809
void QgisApp::selectFeatures()
0 commit comments