How i can insert data to list from database i have already build it and insert into it ?? i build database from two columns and it s variable columns you can insert what you need , i need to retrieve what i insert on each column and insert and save it into list and the second column at same ? what should i do ? i write this code by PyQt4 :
def retrieve(self): #to show all my database
db = QtSql.QSqlDatabase.addDatabase("QSQLITE")
db.setDatabaseName("name.db")
db.open()
query = QSqlQuery()
query.exec_("SELECT * FROM name")
self.model1 = QSqlTableModel(parent=None)
self.model1.setQuery(query)
self.model1.select()
self.tableView.setModel(self.model1)
query.last()