<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019"></HEAD>
<BODY>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=661200008-22042011>I have a dynamic data entry from to which I am adding 
combo boxes on he fly using lists</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=661200008-22042011></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=661200008-22042011> </SPAN> # here I add labels and combo boxes 
to the form from a list 
..<BR>self.dlg.ui.streamEditCustomFormLayout.addWidget(comboBoxNewLabel[dropbox_counter])<BR>self.dlg.ui.streamEditCustomFormLayout.addWidget(comboBoxNew[dropbox_counter])<BR><BR># 
and <SPAN class=661200008-22042011>then </SPAN>add a signal to trigger 
updating <SPAN class=661200008-22042011>of </SPAN>the attribute <SPAN 
class=661200008-22042011>in a </SPAN>table<SPAN class=661200008-22042011> 
</SPAN>with the value selected in the combo box via the changeValue 
function<BR>QObject.connect(comboBoxNew[dropbox_counter],SIGNAL("currentIndexChanged(QString)"),self.changeValue)<BR><BR>the 
function I have works but so is set to change always attribute column 2 (in 
<STRONG>bold</STRONG>)<BR><BR>    def changeValue(self, 
value):<BR>        mc = 
self.canvas        <SPAN 
class=661200008-22042011>          
# the map cabavs uin QGIS</SPAN><BR>        
layer = mc.currentLayer()<SPAN 
class=661200008-22042011>      # a layer in 
QGIS</SPAN><BR>        ob = 
layer.selectedFeaturesIds()<SPAN 
class=661200008-22042011>   </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=661200008-22042011></SPAN>        
layer.changeAttributeValue(int(ob[0]),<STRONG>2</STRONG>,value)<SPAN 
class=661200008-22042011>  # Change value for colum 2 
</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN 
class=661200008-22042011></SPAN></FONT></FONT></FONT> </DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 face=Arial>How 
can I add one additional parameter to the function call form the combo box 
?</FONT></SPAN></DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 
face=Arial>Something like</FONT></SPAN></DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=661200008-22042011>
<DIV dir=ltr align=left><SPAN class=590363701-22042011><FONT color=#000080 
size=2 
face=Arial>QObject.connect(comboBoxNew[dropbox_counter],SIGNAL("currentIndexChanged(QString)"),self.changeValue(self, 
dropbox_counter))</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=590363701-22042011><FONT color=#000080 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=590363701-22042011><FONT color=#000080 
size=2 face=Arial>    def changeValue(self, value, 
colum_id):<BR>        mc = 
self.canvas         
<BR>        layer = 
mc.currentLayer()<BR>        ob = 
layer.selectedFeaturesIds()<BR>        
layer.changeAttributeValue(int(ob[0]),colum_id,value)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=590363701-22042011><FONT color=#000080 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=590363701-22042011><FONT color=#000080 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=590363701-22042011><FONT face=Arial><FONT 
color=#000080><FONT size=2><SPAN class=661200008-22042011>but </SPAN><SPAN 
class=661200008-22042011>with this I</SPAN> am 
getting</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN 
class=590363701-22042011>QObject.connect(comboBoxNew[dropbox_counter],SIGNAL("currentIndexChanged(QString)"),self.changeValue(self, 
dropbox_counter))<BR>TypeError: arguments did not match any overloaded 
call:<BR>  QObject.connect(QObject, SIGNAL(), QObject, SLOT(), 
Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 
'NoneType'<BR>  QObject.connect(QObject, SIGNAL(), callable, 
Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 
'NoneType'<BR>  QObject.connect(QObject, SIGNAL(), SLOT(), 
Qt.ConnectionType=Qt.AutoConnection): argument 2 has unexpected type 
'str'</SPAN></DIV></SPAN></DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=661200008-22042011><FONT color=#000080 size=2 face=Arial>How 
can this be done correctly ?</FONT></SPAN></DIV>
<DIV><FONT size=2><SPAN 
style="FONT-FAMILY: Verdana; FONT-SIZE: 11pt">Karsten</SPAN></FONT></DIV></BODY></HTML>