<div dir="ltr">Matthias, <div><br></div><div style>have a look at the Layer list widget for PyQGIS applications [1], perhaps it could fit your needs.</div><div style><br></div><div style>Not sure if it works on recent QGIS versions, though.</div>

<div style><br></div><div style>Regards, </div><div style><br></div><div style>Germán </div><div style>-----</div><div style>[1] <a href="http://geotux.tuxfamily.org/index.php/en/component/k2/item/270-tabla-de-contenido-leyenda-para-aplicaciones-basadas-en-pyqgis/">http://geotux.tuxfamily.org/index.php/en/component/k2/item/270-tabla-de-contenido-leyenda-para-aplicaciones-basadas-en-pyqgis/</a></div>

<div style><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-04 10:07 GMT-05:00 Martin Dobias <span dir="ltr"><<a href="mailto:wonder.sk@gmail.com" target="_blank">wonder.sk@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matthias<br>
<div class=""><br>
On Wed, Jul 2, 2014 at 4:17 PM, Matthias Ludwig <<a href="mailto:kaotika@gmx.de">kaotika@gmx.de</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I'am writing a data viewer as python qgis standalone application. Is it possible to use the QgisInterface and other classes (like QgsLegendInterface) for layer handling (adding, removing, activation, etc.)?<br>
> Cause I didn't found a way I have written my own layer model based on qts QAbstractListModel. It's working more or less, but I would prever a nativ solution if available.<br>
<br>
</div>QgisInterface and QgsLegendInterface will not work if you are<br>
developing a standalone application. As Andreas suggested, if you base<br>
your application on QGIS 2.4, you can use new layer tree classes:<br>
QgsLayerTreeView + QgsLayerTreeModel for Qt model/view and<br>
QgsLayerTreeGroup + QgsLayerTreeLayer classes for the actual hierarchy<br>
that will be used by the model and view classes. There is some doxygen<br>
documentation in the header files, but I am in the process of<br>
preparing some blog posts about the new classes... stay tuned!<br>
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888">Martin<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>-----------<br>   |\__  <br>(:>__)(<br>   |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>

<a href="http://twitter.com/GeoTux2">http://twitter.com/GeoTux2</a><br>
</div></div>