[Qgis-developer] pyQT combo box & QGIS plug-in signal argumentquestion

karsten vennemann karsten at terragis.net
Fri Apr 22 22:17:38 EDT 2011

Thanks for all the input I received 

I found one seemingly good solution (via internet search) that works using
functools.partial  that is available since python 2.5

My code is then
from functools import partial

ring)"),partial(self.changeValue, x = dropbox_counter))

    def changeValue(self, value, x):                  
        mc = self.canvas                              
        layer = mc.currentLayer()                     
        ob = layer.selectedFeaturesIds()              

Hopefully that helps someone else too when trying to easily pass an
additional parameter  from an QT signal slot ...


> -----Original Message-----
> From: Camilo Polymeris [mailto:cpolymeris at gmail.com] 
> Sent: Friday, April 22, 2011 16:55
> To: karsten vennemann
> Cc: qgis-developer at lists.osgeo.org
> Subject: Re: [Qgis-developer] pyQT combo box & QGIS plug-in 
> signal argumentquestion
> It's not very elegant, but you could use QObject.sender(), 
> see http://doc.qt.nokia.com/4.7/qobject.html#sender
> Regards,
> Camilo

More information about the Qgis-developer mailing list