From 5deb2480181cafb5f29fa26c8ab6058cc7a0a5d5 Mon Sep 17 00:00:00 2001 From: Harrissou Sant-anna Date: Mon, 13 May 2024 20:22:48 +0000 Subject: [PATCH] Fix code sample Without, the project does not "visually" load in QGIS --- docs/pyqgis_developer_cookbook/loadproject.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pyqgis_developer_cookbook/loadproject.rst b/docs/pyqgis_developer_cookbook/loadproject.rst index d23b9f37842..30cb5fc8007 100644 --- a/docs/pyqgis_developer_cookbook/loadproject.rst +++ b/docs/pyqgis_developer_cookbook/loadproject.rst @@ -177,7 +177,7 @@ The following can be done: readflags = Qgis.ProjectReadFlags() readflags |= Qgis.ProjectReadFlag.DontResolveLayers - project = QgsProject() + project = QgsProject.instance() project.read('C:/Users/ClintBarton/Documents/Projects/mysweetproject.qgs', readflags) To add more flags the python Bitwise OR operator (``|``) must be used.