Constructor for QgsProjectDirtyBlocker.
This will block dirtying the specified
projectfor the lifetime of this object.
QgsProject“dirtying” for the lifetime of the object.
QgsProjectDirtyBlockersupports “stacked” blocking, so two
QgsProjectDirtyBlockerscreated for the same project will both need to be destroyed before the project can be dirtied again.
QgsProjectDirtyBlockeronly blocks calls which set the project as dirty - calls which set the project as clean are not blocked.
project = QgsProject.instance() with QgsProject.blockDirtying(project):
# do something