I'm trying to apply customization settings to QGIS consistently at two moments:
- When QGIS opens;
- When new project (with some layers) is loaded.
My code:
from qgis.utils import iface
from qgis.core import QgsProject
def customize():
#some
#customization
#code
iface.initializationCompleted.connect(customize)
QgsProject.instance().legendLayersAdded.connect(customize)
At first moment code works well. But legendLayersAdded
signal works only after I'm adding any other layer to an already loaded project.
Is there a signal emitted after any project (new one or existing with some layers) was loaded into QGIS?