[Qgis-developer] Reliable way to determine a groupIndex in the legend tree

Sandro Santilli strk at keybit.net
Fri Oct 11 02:44:50 PDT 2013


On Fri, Oct 11, 2013 at 11:35:12AM +0200, Bernhard Ströbl wrote:
> 
> 
> Am 11.10.2013 11:22, schrieb Sandro Santilli:
> >On Fri, Oct 11, 2013 at 09:13:03AM +0000, Duarte Carreira wrote:
> >>The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a secondary behavior, like pressing the ctrl key when (un)checking the group checkbox. The primary behavior of the group switch should be to make the children invisible or visible, regardless of the children's visibility being on or off.
> >>
> >>In the primary behavior when the parent is turned OFF, the children are not drawn but retain their checked or uncheck status.
> >>If you use the secondary behavior then unchecking the parent will uncheck the children. Same would apply when checking the parent on.
> >
> >Agreed, sounds like a sensible behavior to me.
> 
> The problem I see is that we have layers visible in the canvas that
> are unchecked, because their group is checked. Maybe an unchecked
> layer should show a partly checked state in that case.

No no, I don't think so. The only way for layers to be visible in the canvas
would be for both them and all their ancestor groups to be checked.
That's my understanding of the suggested behavior.

So if there's a problem of sync between checked status of a layer
and its visibility on the canvas is the contrary one: a layer can
be checked _but_ not visible because any of its ancestors are unchecked.

A "partially checked" kind of visual feedback could be useful for
those cases: whenever a group is unchecked, all checked discendent
become "half-checked" and you can only switch between unchecked
and half-checked by acting on a single layer in that state.

--strk;


More information about the Qgis-developer mailing list