Bug report #12686

layer.featureAdded triggered on Feature Attribute Dialog confirm

Added by Andrew McClure over 4 years ago. Updated almost 4 years ago.

Status:Closed
Priority:High
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

Description

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.

History

#1 Updated by Andrew McClure over 4 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 over 4 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 over 4 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 over 4 years ago

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

not reproducable on master

#5 Updated by Giovanni Manghi almost 4 years ago

  • Status changed from Feedback to Closed

closing for lack of feedback, please reopen if necessary.

Also available in: Atom PDF