PDA

View Full Version : submitALL, QSqlTableModel and QTableView



scott_hollen
8th October 2011, 18:09
Okay all you experts -- just looking for a little explanation...

I have a QTableView which displays data from a QSqlTableModel...I have up and down arrow keys that allow me to highlight a row and have that row move up and down in list dependent on the arrow clicked, and this works perfectly -- with the view being refreshed -- only after I perform a model->submitAll...Is there any way to get the same results, that is, have the view reflect that I moved row 4 up to row 3, *without* have to submit my data? Again it's working fine now, but I'd like to leave all data submissions in the hands of the user via a "SAVE" button (request from the client)...


scott

wysota
8th October 2011, 18:14
Set editStrategy of the model to QSqlTableModel::OnManualSubmit

scott_hollen
8th October 2011, 18:17
That's what I have (I changed it to the other two and messed my data up :) )...That still requires me to submitAll before the QTableView will be refreshed...

wysota
9th October 2011, 09:38
In that case I have no idea what you want.