2

I need to animate the symbology change over a number of steps in a stand-alone PyQt application that uses qgis.core as library for map, my setup is very similar to Animating objects on canvas to change color by delay using PyQGIS?, it actually runs, but the map failed to change and it also gives the following messages:

QObject::connect: Cannot queue arguments of type 'QgsFeatureId'
(Make sure 'QgsFeatureId' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QgsChangedAttributesMap'
(Make sure 'QgsChangedAttributesMap' is registered using qRegisterMetaType().)

so it turns out that the above message was due to I am updating the value attribute of feature via

layer.startEditing()
layer.commitChange()

So, I switch to use data provider to update, now the messages are gone, but it still not changing the map symbology.

  • i think u should show us more precisely the code u're using and where the error is generated ... – snaileater Jun 3 '17 at 15:44
1

The key is to use the dataProvider to update the value of features and not to use the startEditing() and commitChange()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.