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
http://docs.python.org/library/functools.html#functools.partial

My code is then
...
from functools import partial
...

QObject.connect(comboBoxNew[dropbox_counter],SIGNAL("currentIndexChanged(QSt
ring)"),partial(self.changeValue, x = dropbox_counter))

    def changeValue(self, value, x):                  
        mc = self.canvas                              
        layer = mc.currentLayer()                     
        ob = layer.selectedFeaturesIds()              
        layer.changeAttributeValue(int(ob[0]),x,value)

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

Karsten 
 

> -----Original Message-----
> From: Camilo Polymeris [mailto:[email protected]] 
> Sent: Friday, April 22, 2011 16:55
> To: karsten vennemann
> Cc: [email protected]
> 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

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

Reply via email to