Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Storing Changes from TableView to Model to SQLITE Database
rizoritis last edited by
After reading the Qt documentation and playing around with some code I am still a bit confused as to what each part of my code that stores changes to my database actually does. I have the following code:
I am unsure as to whether all three of these calls are necessary to save the changes to my persistent database. In leyman's terms what exactly does transaction() do? Instead of calling submitAll() can I just go straight to commit()?
Seba84 last edited by
You really should not need all of these calls. One of these should be sufficient:
The "QSqlTableModel":http://qt-project.org/doc/qt-5.0/qtsql/qsqltablemodel.html should be already pointing to your database.