[Qgis-user] altering layers order from python plugin

Martin Dobias wonder.sk at gmail.com
Thu Feb 5 05:14:14 PST 2009


On Thu, Feb 5, 2009 at 10:54 AM, Radosław Pasiok <rpasiok at gmail.com> wrote:
> Hello list!
>
> I would like to group and sort layers from python plugin.
> But python console doesn't recognize QgsComposer class.
> Is there any other way to do this?

Hi Radek,

in case you want to move around the layers in the layer list widget
(called legend in qgis), I'm affraid this is not possible. The widget
itself isn't a part of gui library thus not accessible from plugins.
One possibility would be to save the current project, then edit the
project file (change the layer order) and then load it again. Not that
straightforward.

Btw. QgsComposer class is related to composer for printing.

Martin



More information about the Qgis-user mailing list