Hi On Thu, Nov 1, 2012 at 3:37 PM, Martin Dobias <[email protected]> wrote: > > On Thu, Nov 1, 2012 at 12:24 PM, Justin Hubbard > <[email protected]> wrote: >> >> Can iface be called from a standalone PyQGis application? > > > In a standalone PyQGIS application, qgis.utils.iface has no object assigned > (it is None). This makes sense because iface is an interface to a running > QGIS application and with standalone PyQGIS app there isn't one. > > If you need to (e.g. to support python plugins in your application), you can > implement iface yourself (see QgisInterface class). >
Here is a little example of how you might implementing your own iface instance: https://github.com/AIFDR/inasafe/blob/master/safe_qgis/qgis_interface.py Though I suspect you are trying to reuse code from the QGIS application (to show layer properties) which the above approach isnt going to help you with. Regards Tim > Martin > > _______________________________________________ > Qgis-developer mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-developer > -- Tim Sutton - QGIS Project Steering Committee Member (Release Manager) ============================================== Please do not email me off-list with technical support questions. Using the lists will gain more exposure for your issues and the knowledge surrounding your issue will be shared with all. Visit http://linfiniti.com to find out about: * QGIS programming and support services * Mapserver and PostGIS based hosting plans * FOSS Consulting Services Skype: timlinux Irc: timlinux on #qgis at freenode.net ============================================== _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
