Bug report #12686

layer.featureAdded triggered on Feature Attribute Dialog confirm

Added by Andrew McClure almost 9 years ago. Updated over 8 years ago.

Assignee:Matthias Kuhn
Category:Python plugins
Affected QGIS version:2.8.1 Regression?:No
Operating System:OSX, Ubuntu, (Windows not tested) Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:20792


Use case:

Select a vector (point) layer

Make it editable

Select a feature (opens feature Dialog in edit mode if auto open specified)

Click Ok (layer.featureAdded signal is invoked with negative fid. Feature is not updated)

Repeatable - yes.


#1 Updated by Andrew McClure almost 9 years ago

When I don't connect the signal featureAdded, a new feature is created with the correct values from the dialog, but the existing feature remains.

#2 Updated by Andrew McClure almost 9 years ago

This may be part of the problem. On Ubuntu I get the error:

Warning: QUndoStack::endMacro(): no matching beginMacro()

When the signal is connected.

#3 Updated by Andrew McClure almost 9 years ago

It may be that this is how it is designed to work?

I updated to my code in the function connected to featuredAdded to check whether the feature was new or had certain values populated. If the latter, then I knew it was an update and could copy across the values to the original feature then delete the new temporary feature.

Still feels like a bit of a hack.

#4 Updated by Jürgen Fischer almost 9 years ago

  • Resolution set to not reproducable
  • Status changed from Open to Feedback

not reproducable on master

#5 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Feedback to Closed

closing for lack of feedback, please reopen if necessary.

Also available in: Atom PDF