path: root/src/sql/models/qsqltablemodel_p.h
diff options
authorMark Brand <>2013-01-27 17:13:24 +0100
committerThe Qt Project <>2013-02-06 07:57:47 +0100
commitc3ae1c76f349bac2e262929d29163cd9b5d60332 (patch)
treeb9a2626d1c5fa6a6c9a308a801b4086937c7d637 /src/sql/models/qsqltablemodel_p.h
parent33c212b7d25726b78c4bf630548a76feaab872f0 (diff)
QSqlTableModel: support refreshing inserted rows with auto columns
Previously, selectRow() did not work after INSERTing a new row into a table with an automatically populated column. It did not work because the model did not know the primary values for the new row. Newly inserted rows were therefore not refreshed in OnFieldChange and OnRowChange edit strategies. This change provides support for the typical simple case where a single column is populated by the database and can be retrieved with QSqlQuery::lastInsertId(). Task-Number: QTBUG-29102 Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778 Reviewed-by: Andy Shaw <> Reviewed-by: Lukas Geyer <> Reviewed-by: Mark Brand <>
Diffstat (limited to 'src/sql/models/qsqltablemodel_p.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h
index 56db09b7e0..825490ea39 100644
--- a/src/sql/models/qsqltablemodel_p.h
+++ b/src/sql/models/qsqltablemodel_p.h
@@ -96,6 +96,7 @@ public:
QSqlIndex primaryIndex;
QString tableName;
QString filter;
+ QString autoColumn;
enum Op { None, Insert, Update, Delete };