4

QGIS API provides QgsExpressionContextUtils to set project properties.

But in the class, there isn't any signal.

I hope to connect to a signal whenever some of the properties were changed.

So is there a way to implement this?

enter image description here

1 Answer 1

6

Yes, there is a way. It's the customVariablesChanged signal from QgsProject.

def my_slot():
    print("A project variable was just changed!")

QgsProject.instance().customVariablesChanged.connect(my_slot)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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