File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -175,13 +175,16 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
175
175
f->addAttribute ( it.key (), provider->defaultValue ( it.key () ) );
176
176
}
177
177
178
+ vlayer->beginEditCommand ( tr (" Feature added" ) );
179
+
178
180
// show the dialog to enter attribute values
179
181
QSettings settings;
180
182
bool isDisabledAttributeValuesDlg = settings.value ( " /qgis/digitizing/disable_enter_attribute_values_dialog" , false ).toBool ();
181
183
if ( isDisabledAttributeValuesDlg )
182
184
{
183
185
QgsDebugMsg ( " Adding feature to layer" );
184
186
vlayer->addFeature ( *f );
187
+ vlayer->endEditCommand ();
185
188
}
186
189
else
187
190
{
@@ -190,14 +193,17 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
190
193
{
191
194
QgsDebugMsg ( " Adding feature to layer" );
192
195
vlayer->addFeature ( *f );
196
+ vlayer->endEditCommand ();
193
197
}
194
198
else
195
199
{
200
+ vlayer->destroyEditCommand ();
196
201
QgsDebugMsg ( " Adding feature to layer failed" );
197
202
delete f;
198
203
}
199
204
delete mypDialog;
200
205
}
206
+
201
207
mCanvas ->refresh ();
202
208
}
203
209
You can’t perform that action at this time.
0 commit comments