Re: [QGIS-Developer] Read QgsProject properties

2018-02-15 Thread Gerald Kogler
QgsProject.nonIdentifiableLayers() does the trick, so I think it's save
to say that every tag in project .qgs can be accessed through the API


On 14/02/18 22:49, Gerald Kogler wrote:
> 2.18
> 
> thanks
> Gerald
> 
> On 14/02/18 02:06, Gerald Kogler wrote:
>> 2.x
>>
>> On 14/02/18 00:47, Nyall Dawson wrote:
>>> On 14 February 2018 at 08:51, Gerald Kogler  wrote:
 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  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?
>>>
>>> The answer depends which QGIS version you're targetting. Are you
>>> developing for 2.x or 3.0?
>>>
>>> Nyall
>>>
>>
>> ___
>> QGIS-Developer mailing list
>> QGIS-Developer@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
> 
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Read QgsProject properties

2018-02-14 Thread Gerald Kogler
2.18

thanks
Gerald

On 14/02/18 02:06, Gerald Kogler wrote:
> 2.x
> 
> On 14/02/18 00:47, Nyall Dawson wrote:
>> On 14 February 2018 at 08:51, Gerald Kogler  wrote:
>>> 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  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?
>>
>> The answer depends which QGIS version you're targetting. Are you
>> developing for 2.x or 3.0?
>>
>> Nyall
>>
> 
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Read QgsProject properties

2018-02-13 Thread Gerald Kogler
2.x

On 14/02/18 00:47, Nyall Dawson wrote:
> On 14 February 2018 at 08:51, Gerald Kogler  wrote:
>> 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  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?
> 
> The answer depends which QGIS version you're targetting. Are you
> developing for 2.x or 3.0?
> 
> Nyall
> 

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Read QgsProject properties

2018-02-13 Thread Nyall Dawson
On 14 February 2018 at 08:51, Gerald Kogler  wrote:
> 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  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?

The answer depends which QGIS version you're targetting. Are you
developing for 2.x or 3.0?

Nyall
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] Read QgsProject properties

2018-02-13 Thread Gerald Kogler
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  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
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer