diff options
author | Mark Brand <mabrand@mabrand.nl> | 2012-02-16 14:21:07 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-23 23:42:30 +0100 |
commit | 083af1b8cf9e9c805ec41c675728d644d6890578 (patch) | |
tree | 142b32720d7a77f0ab56c93808ef289c0a0be1f8 /src/sql | |
parent | b2c37a81382219b0e1479d30ad4fb57deddd52bf (diff) |
QSqlTableModel: document edit strategy behavior
Change-Id: Ib674288e950837aa343cf1206ed081386b1fff0d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 5c84dda1d9..309c01d7ee 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -1050,6 +1050,8 @@ bool QSqlTableModel::removeRows(int row, int count, const QModelIndex &parent) Returns false if the parameters are out of bounds; otherwise returns true. + Does not submit rows, regardless of edit strategy, not even OnFieldChange. + \sa primeInsert(), insertRecord() */ bool QSqlTableModel::insertRows(int row, int count, const QModelIndex &parent) @@ -1097,7 +1099,11 @@ bool QSqlTableModel::insertRows(int row, int count, const QModelIndex &parent) Returns true if the record could be inserted, otherwise false. - \sa insertRows(), removeRows() + Changes are submitted immediately for OnFieldChange and + OnRowChange. Note the contrast with setRecord() in respect to + OnRowChange. + + \sa insertRows(), removeRows(), setRecord() */ bool QSqlTableModel::insertRecord(int row, const QSqlRecord &record) { @@ -1210,7 +1216,13 @@ Qt::ItemFlags QSqlTableModel::flags(const QModelIndex &index) const Returns true if all the values could be set; otherwise returns false. - \sa record() + The edit strategy affects automatic submitting. + With OnFieldChange, setRecord() commits its changed row. + With OnRowChange, setRecord() does not commit its changed row, + but making a change to another row causes previous changes to + be submitted. + + \sa record(), editStrategy() */ bool QSqlTableModel::setRecord(int row, const QSqlRecord &record) { |