On 10/20/14 6:10 PM, Tendfly niu wrote:
Hi all,
I'm using QGIS-2.4.0 API. I saved a test.qgs file in QGIS Desktop, in
this project, there is one layer in it.

Then I open the test.qgs project file in QGIS API to developing, but it
is not showed in APP.

Why is that?
The code I'm using to open the project is:
     QString myProjectPath = "E:\\QGIS\\Pro\\test.qgs";
     Qgsproject::instance()->setFileName(myProjectPath);
     bool isRead = QgsProject::instance()->read();

In Debug mode, isRead equals TRUE.


Use:

iface.addProject(myProjectPath)


Any advice would be appreciated!

Regards,

Bob



_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Gary Sherman

Founder, QGIS Project
Consulting: geoapt.com
Publishing: locatepress.com

We work virtually anywhere
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to