[Qgis-developer] Field calculator does attribute changes silently
marco.hugentobler at sourcepole.ch
Tue Jan 7 00:34:09 PST 2014
I remember there was a performance consideration leading to the
emitSignal parameter in changeAttributeValue. But I don't know if it is
still needed, seems to be only used from field calculator, offline
editing and a label tool.
So +1 for your proposal.
On 06.01.2014 14:01, Matthias Kuhn wrote:
> Currently,when the field calculator does changes to attributes
> (modification, not adding a new column) it blocks signals of the
> vector layer while doing this. This leads e.g. to bug #9268 , that
> the attribute table is not updating properly. The fix would be very
> easy (i.e. remove the blockSignals() call) but I wanted to ask first,
> if there is a reason not to do this.
> The main reason why I am afraid is, that apart from the blockSignals()
> call, there is also the paramter emitSignal specified as false in the
> call to vectorlayer->changeAttributeValue(). This parameter is
> currently not working, so I suppose that the blockSignals() call was
> introduced as a workaround.
> However, there was a good reason, to block the signals explained in
> issue #7071 , fixed by Jürgen, that at the time when we only
> supported one iterator per layer, emitting this signal would break the
> update process and produce only partially updated results. This is
> fortunately no longer the case, so this reason can be considered
> Another reason which I could imagine (but I have no proof of) is that
> for big layers, emitting the signal for each feature can possibly take
> a long time. However, if this is actually the case we should rather
> think about batching the signal or fix unperformant consumer slots of
> this signal.
> Be aware, that at the current state, there is no possibility, neither
> for plugins nor in QGIS core, to get reliable push-notifications when
> an attribute changes.
> So my proposal is:
> * Remove the blockSignal calls and let attribute changes always be
> * If there are problems introduced, lets fix the problems instead of
> working around them at the cost of unreliability
> * Don't fix the emitSignal parameter for
> QgsVectorLayer::changeAttribute and deprecate it for future removal.
> If there is no objection, I would vote to make this changes before the
> QGIS 2.2 freeze
>  http://hub.qgis.org/issues/9268
>  http://hub.qgis.org/issues/7071
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
Dr. Marco Hugentobler
Sourcepole - Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee
More information about the Qgis-developer