how get the row state of a row in QSqlTableModel?
-
31-05-2021 - |
Pergunta
I have a QSqlRelationalTableModel
. I am using OnManualSubmit
for my edit strategy. I have called setTable
and insertRow
.
Later, how do I know programmatically which rows have been added or edited in the model but have not yet been submitted to the database?
Solução
Qt doesn't expose the list of pending updates, insertion or deletion, you can only check individual indexes with QSqlTableMode::isDirty
.
But since you have access to the signals rowsInserted
, rowsRemoved
and dataChanged
, you can build these lists yourself.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow