Bug report #13154

Feature count doesn't update

Added by hossein arshad about 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/SpatiaLite
Affected QGIS version:2.10.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:21217

Description

When I add some items to the vector layer and then delete them then I run a script which looks in the vector layer and if the feature count is 0 it refills it again. but the problem is feature count is showing the previous features even though there is no feature in vector layer.

Capture.JPG (167 KB) hossein arshad, 2015-07-25 11:25 AM

History

#1 Updated by Matthias Kuhn about 5 years ago

From the script you have open in the background it looks as if you are adding features directly on the provider, bypassing the layer (Using layer.dataProvider().addFeatures() instead of layer.addFeature() with startEditing() / commitChanges() ).

This way you change the data directly on the provider and bypass the internal mechanism to update gui elements (like canvas, attribute table) in sync and metadata like feature count may be wrong.

#2 Updated by Giovanni Manghi about 5 years ago

  • OS version deleted (2.10.1)
  • Operating System deleted (QGIS Pisa)
  • Status changed from Open to Feedback

#3 Updated by Giovanni Manghi almost 5 years ago

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

Closing for lack of feedback. Reopen if necessary.

Also available in: Atom PDF