[QGIS-Developer] Read QgsProject properties

Gerald Kogler geraldo at servus.at
Tue Feb 13 14:51:19 PST 2018


Hi,

I'm doing my first explorations into pyqgis and I'm quite amazed,
compliments for the design of the QGIS API!

So far I recursively read layer groups and layers from QgsProject and
write a json file which I then use to build a layer switcher for Openlayers.

Now I need to add additional information which is part of .qgs project
file, but I don't have any clue how to access it without parsing the
XML. Everything from .qgs can be read by API methods?

For example, I want to add to each layer its "Identifiable" info. There
is a XML tag called <Identify> in .qgs, how do I get there? I tried with
readEntry() and readListEntry() but without success.

Or is there any handy reference of all the project properties and how to
read them by the API?

Thanks
Gerald


More information about the QGIS-Developer mailing list