Bug report #14490

QgsMapLayer::dataChanged not emited when QgsVectorLayer data are modified

Added by Vincent Mora over 6 years ago. Updated over 3 years ago.

Category:Data Provider
Affected QGIS version:2.8.3 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:22466


To reproduce activate a vector layer, and in the in the python console:

def prt():
print "changed"

Open the attribute table and change an attribute, save -> nothing


Works instead, but it's not really the first thing that comes to mind (actually it only came to mine by looking at QgsVectorLayer::commitChanges source code).


#1 Updated by Giovanni Manghi over 6 years ago

  • Category set to Python plugins

#2 Updated by Hugo Mercier over 6 years ago

  • Status changed from Open to Feedback
  • Category changed from Python plugins to Data Provider

Indeed. Also observed on 2.15

Actually, this dataChanged signal seems to be used only on setSubsetString() of each provider ...
There is also a layerModified signal which is only emitted when attribute aliases are created or removed ...

A "something has changed" signal (for feature addition/removal/modification) could be helpful.

What about choosing only one signal and emitting it when one of the other modification signals is emitted ? (maybe for qgis 3.0)

#3 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Feedback to Open

#4 Updated by Giovanni Manghi over 5 years ago

  • Regression? set to No
  • Easy fix? set to No

#5 Updated by Giovanni Manghi over 3 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF