Skip to content

Commit

Permalink
doc: Explicitly mention that QSqlRecord fields are generated by default
Browse files Browse the repository at this point in the history
Task-number: QTBUG-38460
Change-Id: I5982d018ebf239eb95dba59e2c5559bf5b5ce6ca
Reviewed-by: Venugopal Shivashankar <[email protected]>
  • Loading branch information
AndyShawQt committed May 23, 2018
1 parent 57868b6 commit 4deea4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sql/models/qsqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4deea4b

Please sign in to comment.