[Qgis-developer] pyQT combo box & QGIS plug-in signal argument
question
karsten vennemann
karsten at terragis.net
Fri Apr 22 17:32:00 EDT 2011
Hi all,
in a python QGIS plug-in I have a form with a dynamically generated pyQT combo box.
Now I am trying to have a change in the combo box send a signal with one argument (which is the id of combo box) to the called function changeValue. Note this changes the attribute of one field in a shape file attribute table and I need the combo box id to know which field will be changed by the changeValue function). How can I do this ?
So far I have.
QObject.connect(comboBoxNew[dropbox_counter],SIGNAL("currentIndexChanged(QString)"),self.changeValue)
def changeValue(self, value):
mc = self.canvas
layer = mc.currentLayer()
ob = layer.selectedFeaturesIds()
layer.changeAttributeValue(int(ob[0]),self.id(),value)
Thanks for any hints as I have been stuck with this for days ;)
Cheers
Karsten Vennemann
More information about the Qgis-developer
mailing list