1

I'm working in a project and i need to load some layers at startup. I do it adding this code to startup file localted in the bin folder.

capa = QgsVectorLayer('Polygon?crs=epsg:32614&field=yeah:string(30)&index=yes', 'capita', "memory")
QgsProject.instance().addMapLayer(capa)

This step is right, however, when i start qgis, it asks if i want to save, discard o cancel changes. If i select save or discard, it creates a new project without my layers. but if i chose to cancel changes, nothing else happens and my layers are there ok (and this is what i want)

Does anybody knows how to hide that prompt and let my layers to be loaded without ask me to save?

Your Answer

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

Browse other questions tagged or ask your own question.