[Qgis-developer] index in self.legend.groupLayerRelationship - different behavior between QGIS 1.8 and master?

Andreas Neumann a.neumann at carto.net
Tue Sep 25 09:06:42 PDT 2012


 Hi,

 When testing a self-written plugin, I noticed a different behavior 
 between QGIS 1.8 and master.

 I used the following code to move a layer into a certain group which I 
 detected by name:

 here is the code:

 	groups = []
 	for group in self.legend.groupLayerRelationship():
 		groups.append(group[0])
 	groupIndex = groups.index(groupName)
 	#move new layer to existing group
 	self.legend.moveLayer(schuelerLayer, groupIndex)

 While this works fine in QGIS 1.8, in QGIS master it is shifted to one 
 group below the correct group. Did some behavior of the groupIndex 
 change?

 Thanks,
 Andreas

-- 
 --
 Andreas Neumann
 Böschacherstrasse 10A
 8624 Grüt (Gossau ZH)
 Switzerland


More information about the Qgis-developer mailing list