diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-05-15 10:15:49 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-05-23 07:01:39 +0000 |
commit | 4deea4b905ea1ad32fde317f8556a5c8cdd775cd (patch) | |
tree | 0234ddf1ec83924cd439bf8401e176301f4dd721 /src/sql | |
parent | 57868b60814f012d5514b32f77a0a28408362741 (diff) |
doc: Explicitly mention that QSqlRecord fields are generated by default
Task-number: QTBUG-38460
Change-Id: I5982d018ebf239eb95dba59e2c5559bf5b5ce6ca
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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. |