Well, the 'actionAddToOverview' method from QgisInterface do work, just add this line to your code: <br><br> self.iface.actionAddToOverview().activate( 0 ) # '0' is the signal to emit, in this case "QAction.triggered()"<br>
<br>And this way you activate the AddToOverview action from QGis. It adds the active layer to overview map. So, you don't need the workaround.<br><br>Regards.<br><br>Germán<br><br><div class="gmail_quote">El 22 de septiembre de 2009 11:38, Germán Carrillo <span dir="ltr"><<a href="mailto:carrillo.german@gmail.com">carrillo.german@gmail.com</a>></span> escribió:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Michele.<br><br>It seems the 'actionAddToOverview' method doesn't work yet. As a workaround, you could do something like this:<br>
<br> layer = self.iface.activeLayer()<br> mapCanvasLayer = QgsMapCanvasLayer( layer )<br>
mapCanvasLayer.setInOverview( True )<br> self.iface.mapCanvas().setLayerSet( [ mapCanvasLayer ] ) <br><br>Regards. <br><br>Germán<br><br><div class="gmail_quote">El 22 de septiembre de 2009 09:40, Michele Mammini <span dir="ltr"><<a href="mailto:mamminim@yahoo.it" target="_blank">mamminim@yahoo.it</a>></span> escribió:<div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
Hi Germán<br><br>
may you write me how to write the code in my plugin in order to use this
method?<br>
Maybe I understood that I have to use the class QAction() but i don't
understand how to use it.<br><br>
Thank you <br><br>
Michele.<div><div></div><div><br><br>
At 16.19 21/09/2009, you wrote:<br>
<blockquote type="cite">Hi Michele. <br><br>
There is an 'actionAddToOverview' method in QgisInterface class [1], so
you could use it directly for your plugin.<br><br>
Regards,<br><br>
Germán<br><br>
---------------------------<br>
[1]
<a href="http://doc.qgis.org/head/classQgisInterface.html" target="_blank">
http://doc.qgis.org/head/classQgisInterface.html</a><br><br>
<br>
2009/9/21 Michele Mammini
<<a href="mailto:mamminim@yahoo.it" target="_blank">mamminim@yahoo.it</a>><br>
<dl>
<dd>Dear all,<br><br>
</dd><dd>i'm new on QGis, and i'm starting to develop plugin for my project
using Python and QT.<br>
</dd><dd>I'm able to connect to PostGIS database to query the data and to load
the Layer into QGis, but i'm not able to load the same layer in the
Overview windows.<br>
</dd><dd>May someone can suggest me which function/class/code allow me to do
it?<br><br>
</dd><dd>Thank you,<br><br>
</dd><dd>Michele.<br><br>
</dd><dd>_______________________________________________<br>
</dd><dd>Qgis-developer mailing list<br>
</dd><dd><a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">
Qgis-developer@lists.osgeo.org</a><br>
</dd><dd>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br><br>
</dd></dl><br>
-- <br>
-----------<br>
|\__ <br>
(:>__)(<br>
|/ <br><br>
Soluciones Geoinformáticas
Libres
<br>
<a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a>
</blockquote>
</div></div><p>
<br>
<font color="#000080">
______________________________________________________________________<br>
<b><i>Michele Mammini<br>
</i></b>Via dell'Arno, 54 - San Benedetto<br>
56021<br>
Cascina (PISA)<br><br>
Tel<i>:
+39 050
747037<br>
</i>Cell<i>:
+39 328
9039640<br><br>
</i>email:
<a href="mailto:mamminim@yahoo.it" target="_blank"><i>
mamminim@yahoo.it</i></a><br>
Skype: <i>mamminim<br>
</i>
_____________________________________________________________________
</font></p></div>
</blockquote></div></div></div>-- <br>-----------<br> |\__ <br>(:>__)(<br> |/ <div><div></div><div class="h5"><br><br>Soluciones Geoinformáticas Libres <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br>
<br>
</div></div></blockquote></div>-- <br>-----------<br> |\__ <br>(:>__)(<br> |/ <br><br>Soluciones Geoinformáticas Libres <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>