QSqlTableModel::removeRows() enforce edit strategy
authorMark Brand <mabrand@mabrand.nl>
Thu, 15 Mar 2012 10:23:27 +0000 (11:23 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 15 Mar 2012 14:35:43 +0000 (15:35 +0100)
commit26450fe6a6340b09b1e3fa49c35028aa15ef223f
tree3c39e9d1aebb649953e6a758c0820702083e502c
parent108748404beb607538ea965a21fa932d275eecdd
QSqlTableModel::removeRows() enforce edit strategy

For OnFieldChange and OnRowChange, we don't want more than one row in
the cache with uncommitted changes. This could happen if deletion in
the database fails while other changes are pending.

Chosen solution is to return false if other rows have pending changes.
Also, we only allow 1 row removed at a time.

Updated test, changes and documentation.

Change-Id: I68baf6d221789b4754e891535070011c759a2155
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
dist/changes-5.0.0
src/sql/models/qsqltablemodel.cpp
tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp