[Qgis-user] Qgis2.8 mapcomposer related plugin

Nyall Dawson nyall.dawson at gmail.com
Tue Jun 16 02:55:34 PDT 2015


On 16 Jun 2015 12:33 pm, "邓冲" <buynowdays at hotmail.com> wrote:
>
> My environment is :window 7, Qgis2.8.2, standalone install.
>
> I'm developing a qgis python plugin about mapcomposer.
>
> My qgis project has some mapcomposer template, which contains some soild
combination of base shp layers.For some reason, i have to choose the
mapcomposer mapitem's "Lock layers for map item" and "Lock layer styles for
map item" options, then i need add a shp layer to mainwindow's canvas and
update that layer to the mapcomposer item. What makes me mad is, when i
choose that two options, i can't add the layer to mapitem; when i cancle
them, it will update all mainwindow's layer to the mapitem, which is
useless.
>
> Here is my question, how to add a layer to the locked map composer item.

Use QgsComposerMap::setLayerSet [1]

Nyall

1.
http://qgis.org/api/classQgsComposerMap.html#add4db2cc8afa366c4ed07a73b55a8cb3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150616/de47492b/attachment.html>


More information about the Qgis-user mailing list