Well, the &#39;actionAddToOverview&#39; method from QgisInterface do work, just add this line to your code: <br><br>      self.iface.actionAddToOverview().activate( 0 ) # &#39;0&#39; is the signal to emit, in this case &quot;QAction.triggered()&quot;<br>
<br>And this way you activate the AddToOverview action from QGis. It adds the active layer to overview map. So, you don&#39;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">&lt;<a href="mailto:carrillo.german@gmail.com">carrillo.german@gmail.com</a>&gt;</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 &#39;actionAddToOverview&#39; method doesn&#39;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">&lt;<a href="mailto:mamminim@yahoo.it" target="_blank">mamminim@yahoo.it</a>&gt;</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&#39;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 &#39;actionAddToOverview&#39; 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
&lt;<a href="mailto:mamminim@yahoo.it" target="_blank">mamminim@yahoo.it</a>&gt;<br>

<dl>
<dd>Dear all,<br><br>

</dd><dd>i&#39;m new on QGis, and i&#39;m starting to develop plugin for my project
using Python and QT.<br>

</dd><dd>I&#39;m able to connect to PostGIS database to query the data and to load
the Layer into QGis, but i&#39;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>
(:&gt;__)(<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&#39;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>(:&gt;__)(<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>(:&gt;__)(<br>  |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>