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

3rd May 2020, 7:17 AM
Ptar*
Ptar* - avatar
8 Answers
+ 3
https://code.sololearn.com/WLLbDNcB05bE/#html
3rd May 2020, 7:43 AM
Ptar*
Ptar* - avatar
+ 3
@Tashi N, have you done something on it, can't see.
3rd May 2020, 7:49 AM
Ptar*
Ptar* - avatar
+ 3
Okay, thanks.
3rd May 2020, 7:55 AM
Ptar*
Ptar* - avatar
+ 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()
3rd May 2020, 7:31 AM
Ptar*
Ptar* - avatar
+ 1
I added the code to the description to help you to receive useful answers.
3rd May 2020, 7:54 AM
Tashi N
Tashi N - avatar