Why it only show 1 name in my database i have 5 what is wrong with my code?
-
wrote on 20 Jan 2017, 15:45 last edited by VRonin
self.query = QSqlQuery("SELECT name FROM test_table") # while(self.query.next()): self.cb = QComboBox(self) self.cb.addItem(self.query.value(0).toString()) # self.show()
-
@Gelo Not exactly sure about python but it seems you are creating a new
QComboBox
inside the loop everytime it iterates. -
@Gelo Not exactly sure about python but it seems you are creating a new
QComboBox
inside the loop everytime it iterates.wrote on 20 Jan 2017, 17:55 last edited by@p3c0 Thank you! i already solve the problem ^_^
1/3