Hi Matthias

On Wed, Jul 2, 2014 at 4:17 PM, Matthias Ludwig <[email protected]> wrote:
>
> Hi,
>
> 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.)?
> 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.

QgisInterface and QgsLegendInterface will not work if you are
developing a standalone application. As Andreas suggested, if you base
your application on QGIS 2.4, you can use new layer tree classes:
QgsLayerTreeView + QgsLayerTreeModel for Qt model/view and
QgsLayerTreeGroup + QgsLayerTreeLayer classes for the actual hierarchy
that will be used by the model and view classes. There is some doxygen
documentation in the header files, but I am in the process of
preparing some blog posts about the new classes... stay tuned!

Regards
Martin
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to