I want is that when the user clicks Save button, then only the changes should be written to the database, till then the changes should only be displayed on the table (not in the database), whereas QSqlTableModel is updating the database while editing..
model = new QSqlTableModel();
model->setTable(table_name);
model->select();
I’m using the above code..
Any help is appreciated..
Thanks 🙂
Edit : using Qt 4.8
You could use QSqlTableModel::setEditStrategy to change the submit behaviour.
In your SaveButtonClickedSlot you have to call: