[Qgis-developer] writeMapLayer not connecting in Python

Gino Pirelli luipir at gmail.com
Wed Oct 30 06:54:21 PDT 2013


usually appends due to mismatch in callback signature... colud be
necessarry add "self" to def?

def write2(layer, dom, dom2): <--> def write2(self, layer, dom, dom2):

??

ciao ginetto


On 30 October 2013 14:23, Nathan Woodrow <madmanwoo at gmail.com> wrote:

> Hey all,
>
> I seem to be having issues with connecting to QgsProject::writeMapLayer in
> Python.
> Using new style connections I get an error:
>
> >>> QgsProject.instance().writeMapLayer.connect(layerwrite)
>
> yields
>
> TypeError: connect() failed between
> writeMapLayer(QgsMapLayer*,QDomElement,QDomDocument) and unislot()
>
> Trying to connect using the old style connect just doing ever get called:
>
> def write2(layer, dom, dom2):
>     print layer, dom, dom2
>
> QObject.connect(QgsProject.instance(), SIGNAL("writeMapLayer( QgsMapLayer,
> QDomElement, QDomDocument )"), write2)
>
> This should be called when ever the project is saved and the layer is
> written however it just never calls the slot.
>
> Doing something wrong?
>
> - Nathan
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131030/bfc38770/attachment.html>


More information about the Qgis-developer mailing list