mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
[ui] Fix addition of geometryless feature not working after first click on add record toolbar action
This commit is contained in:
parent
4344d92386
commit
39d6f8392c
@ -51,6 +51,8 @@ Change the layer edited by the map tool
|
||||
|
||||
virtual void deactivate();
|
||||
|
||||
virtual void reactivate();
|
||||
|
||||
|
||||
virtual void keyPressEvent( QKeyEvent *e );
|
||||
|
||||
|
||||
@ -51,6 +51,8 @@ Change the layer edited by the map tool
|
||||
|
||||
virtual void deactivate();
|
||||
|
||||
virtual void reactivate();
|
||||
|
||||
|
||||
virtual void keyPressEvent( QKeyEvent *e );
|
||||
|
||||
|
||||
@ -131,6 +131,18 @@ void QgsMapToolDigitizeFeature::deactivate()
|
||||
emit digitizingFinished();
|
||||
}
|
||||
|
||||
void QgsMapToolDigitizeFeature::reactivate()
|
||||
{
|
||||
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mLayer );
|
||||
if ( !vlayer )
|
||||
vlayer = currentVectorLayer();
|
||||
|
||||
if ( vlayer && vlayer->geometryType() == Qgis::GeometryType::Null )
|
||||
{
|
||||
layerGeometryCaptured( QgsGeometry() );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolDigitizeFeature::keyPressEvent( QKeyEvent *e )
|
||||
{
|
||||
if ( e->key() == Qt::Key_Escape )
|
||||
|
||||
@ -55,6 +55,7 @@ class GUI_EXPORT QgsMapToolDigitizeFeature : public QgsMapToolCaptureLayerGeomet
|
||||
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
void reactivate() override;
|
||||
|
||||
// Overridden to emit digitizingCanceled when ESC is pressed
|
||||
void keyPressEvent( QKeyEvent *e ) override;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user