0
If this is related to sololearn, please help
I have a QComboBox with 4 options. I'd like to choose an option and the corresponding data from Sqlite3 displays on the QTableWidget. No documentation online has helped. Somebody help please. Code: https://code.sololearn.com/WLLbDNcB05bE/#html
8 Antworten
+ 3
https://code.sololearn.com/WLLbDNcB05bE/#html
+ 3
@Tashi N, have you done something on it, can't see.
+ 3
Okay, thanks.
+ 1
def fetch_learner_data_from_combo(self):
connection= sqlite3.connect("mydb.db")
querry = "SELECT * FROM learner_data WHERE STREAM="+str(self.stream_combo.currentText())
result = connection.execute(querry)
self.marks_table.setRowCount(0)
for row_number,row_data in enumerate(result):
self.marks_table.insertRow(row_number)
for column_number,data in enumerate(row_data):
self.marks_table.setItem(row_number,column_number,QTableWidgetItem(str(data)))
connection.commit()
connection.close()
+ 1
I added the code to the description to help you to receive useful answers.