diff options
Diffstat (limited to 'src/sql/models/qsqltablemodel.cpp')
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index d2b9427287..a313014abc 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -80,6 +80,8 @@ bool QSqlTableModelPrivate::setRecord(int row, const QSqlRecord &record) if (strategy == QSqlTableModel::OnFieldChange) strategy = QSqlTableModel::OnRowChange; for (int i = 0; i < record.count(); ++i) { + if (!record.isGenerated(i)) + continue; int idx = nameToIndex(record.fieldName(i)); if (idx == -1) continue; @@ -1353,7 +1355,8 @@ bool QSqlTableModel::setRecord(int row, const QSqlRecord &record) if (idx == -1) { isOk = false; } else { - QSqlTableModelPrivate::setGeneratedValue(mrow.rec, idx, record.value(i)); + mrow.rec.setValue(idx, record.value(i)); + mrow.rec.setGenerated(idx, record.isGenerated(i)); } } |