mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Reset digitizing tools when new project is loaded/created
Refs #4237 https://issues.qgis.org/issues/4237
This commit is contained in:
parent
b00a60da01
commit
479e3cb736
@ -114,11 +114,6 @@ Removes the last vertex from mRubberBand and mCaptureList
|
||||
:rtype: bool
|
||||
%End
|
||||
|
||||
void stopCapturing();
|
||||
%Docstring
|
||||
Stop capturing
|
||||
%End
|
||||
|
||||
int size();
|
||||
%Docstring
|
||||
Number of points digitized
|
||||
@ -146,6 +141,13 @@ Removes the last vertex from mRubberBand and mCaptureList
|
||||
Close an open polygon
|
||||
%End
|
||||
|
||||
protected slots:
|
||||
|
||||
void stopCapturing();
|
||||
%Docstring
|
||||
Stop capturing
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
@ -36,6 +36,8 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapToolCapture *par
|
||||
{
|
||||
connect( mCanvas, &QgsMapCanvas::mapToolSet, this, &QgsMapToolAddCircularString::setParentTool );
|
||||
}
|
||||
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
|
||||
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
|
||||
}
|
||||
|
||||
QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapCanvas *canvas )
|
||||
|
@ -40,6 +40,8 @@ QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas *canvas, CaptureMode mo
|
||||
, mCheckGeometryType( true )
|
||||
{
|
||||
mToolName = tr( "Add feature" );
|
||||
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
|
||||
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
|
||||
}
|
||||
|
||||
QgsMapToolAddFeature::~QgsMapToolAddFeature()
|
||||
|
@ -31,6 +31,8 @@ QgsMapToolAddPart::QgsMapToolAddPart( QgsMapCanvas *canvas )
|
||||
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget() )
|
||||
{
|
||||
mToolName = tr( "Add part" );
|
||||
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
|
||||
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
|
||||
}
|
||||
|
||||
QgsMapToolAddPart::~QgsMapToolAddPart()
|
||||
|
@ -29,6 +29,8 @@ QgsMapToolAddRing::QgsMapToolAddRing( QgsMapCanvas *canvas )
|
||||
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), QgsMapToolCapture::CapturePolygon )
|
||||
{
|
||||
mToolName = tr( "Add ring" );
|
||||
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
|
||||
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
|
||||
}
|
||||
|
||||
QgsMapToolAddRing::~QgsMapToolAddRing()
|
||||
|
@ -147,11 +147,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
|
||||
*/
|
||||
bool isCapturing() const;
|
||||
|
||||
/**
|
||||
* Stop capturing
|
||||
*/
|
||||
void stopCapturing();
|
||||
|
||||
/**
|
||||
* Number of points digitized
|
||||
*
|
||||
@ -177,6 +172,13 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
|
||||
*/
|
||||
void closePolygon();
|
||||
|
||||
protected slots:
|
||||
|
||||
/**
|
||||
* Stop capturing
|
||||
*/
|
||||
void stopCapturing();
|
||||
|
||||
private:
|
||||
//! whether tracing has been requested by the user
|
||||
bool tracingEnabled();
|
||||
|
Loading…
x
Reference in New Issue
Block a user