I have the following function to fill a comboBox with the data entered in the form by the user, this works correctly.
def onTextChanged(self, text):
if text:
sql = ("SELECT sec.Nombre as Seccion,sec,idSeccion FROM [Lote] lot \
inner join [Seccion] sec on sec.idInforme = lot.idInforme \
Where idLote = '%s'") % \
(self.dlg.lote.text())
cursorLista.execute(sql)
self.dlg.comboBox.clear()
self.dlg.comboBox.addItems([str(x[0]) for x in cursorLista])
Then I'll call from
self.dlg.lote.textChanged.connect(self.onTextChanged)
result = self.dlg.exec_()
The problem is that now I need to get the id of the section that was selected in the comboBox and save it in a variable, as I can get it since in the query I am bringing all the idSeccion for that Batch.