From 4deea4b905ea1ad32fde317f8556a5c8cdd775cd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 15 May 2018 10:15:49 +0200 Subject: doc: Explicitly mention that QSqlRecord fields are generated by default Task-number: QTBUG-38460 Change-Id: I5982d018ebf239eb95dba59e2c5559bf5b5ce6ca Reviewed-by: Venugopal Shivashankar --- src/sql/models/qsqltablemodel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/sql') diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 05feb87466..865f76c73a 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -1368,12 +1368,12 @@ QSqlRecord QSqlTableModel::record(int row) const target fields are mapped by field name, not by position in the record. - Note that the generated flags in \a values are preserved - and determine whether the corresponding fields are used when - changes are submitted to the database. The caller should - remember to set the generated flag to FALSE for fields - where the database is meant to supply the value, such as an - automatically incremented ID. + Note that the generated flags in \a values are preserved to + determine whether the corresponding fields are used when changes + are submitted to the database. By default, it is set to \c true + for all fields in a QSqlRecord. You must set the flag to \c false + using \l{QSqlRecord::}{setGenerated}(false) for any value in + \a values, to save changes back to the database. For edit strategies OnFieldChange and OnRowChange, a row may receive a change only if no other row has a cached change. -- cgit v1.2.3