[Qgis-developer] PyQGIS signal slot problem

Marco Hugentobler marco at hugis.net
Fri Apr 23 17:57:03 EDT 2010


Hi Python experts

I'm trying to connect to the signal QgisInterface::composerAdded( 
QgsComposerView* v ) with python. However, I only get a QGraphicsView object 
(so the parent class of composer view), not a QgsComposerView instance. Is 
there some sip magic that needs to be done? Or something else that I'm doing 
wrong?

My python code:

#connect to composerAdded signal from plugin
QObject.connect( self.iface,  SIGNAL("composerAdded( QgsComposerView* )"), 
self.onComposerAdded )

#and here the slot
def onComposerAdded(self,  composerview):
  print composerview


Regards,
Marco




-- 
Dr. Marco Hugentobler
HUGIS GmbH
Webereistr. 66
CH-8134 Adliswil
marco at hugis.net
www.hugis.net
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list