Jul-20-2018, 03:11 AM
So this has been frustrating me for to man hours, and i have no been able to find the answer in the google.
Im trying to query my db to get a distinct list from a certain row, and then take list and populate a combobox with it.
I keep getting this error: TypeError: addItems(self, Iterable[str])
here is the code in question.
Any help would be greatly appreciated, i feel like its something so simple.
Im trying to query my db to get a distinct list from a certain row, and then take list and populate a combobox with it.
I keep getting this error: TypeError: addItems(self, Iterable[str])
here is the code in question.
######Combo Box 2 - PM's self.groupBox_2 = QtWidgets.QGroupBox(self.tab) self.groupBox_2.setGeometry(QtCore.QRect(10, 140, 191, 51)) self.groupBox_2.setObjectName("groupBox_2") self.comboBox_3 = QtWidgets.QComboBox(self.groupBox_2) self.comboBox_3.setGeometry(QtCore.QRect(10, 20, 171, 22)) self.comboBox_3.setObjectName("comboBox_3") self.comboBox_3.addItems(self.pm_Combo) def pm_Combo(self): conn = sqlite3.connect('testdb.db') c = conn.cursor() c.execute("SELECT DISTINCT projectmanager FROM testtable2") pmList = c.fetchall() conn.commit() conn.close()indention is not correct since im just copying the relevant parts of the code
Any help would be greatly appreciated, i feel like its something so simple.