[Qgis-developer] currentLayerChanged() SIGNAL on right click in interface Legend

Larry Shaffer larrys at dakotacarto.com
Sat Aug 24 09:03:38 PDT 2013


Hi Alexandre,

On Sat, Aug 24, 2013 at 8:23 AM, Alexandre Neto <senhor.neto at gmail.com>wrote:

> Hi,
>
> After right or left clicking the interface legend in an empty space,
>
> iface.mapCanvas.currentLayer() == None
>
> Shouldn't currentLayerChanged() signal be thrown? It does not seem to.
>

I can not verify the same behavior on Mac. As far as I can tell, it is
working like that already. In console:

def print_active_layer(layer):
    print layer

iface.currentLayerChanged["QgsMapLayer *"].connect(print_active_layer)

Changing the active layer, including clicking in empty space emits the
signal.

A while back, I made several changes that separated the visual feedback
between active layer and current selection. For example, you can have no
selection and still have an active layer. This is important to how
selections should function and is more inline with other GUIs. Active
layers are now represented with an underlined layer name.

For example, clicking on a symbology row, under a layer, will clear the
selection (but not the active layer), and clicking empty space with clear
both the selection and active layer.

Regards,

Larry



> Thanks,
>
> Alexandre Neto
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130824/820ac4d4/attachment.html>


More information about the Qgis-developer mailing list