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?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityYes, 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)