summaryrefslogtreecommitdiffstats
path: root/src/sql/models
diff options
context:
space:
mode:
authorSze Howe Koh <szehowe.koh@gmail.com>2020-01-18 16:07:21 +0800
committerSze Howe Koh <szehowe.koh@gmail.com>2020-01-19 07:19:47 +0800
commit520f7bb8323814593b9733aee3b800884cd39dff (patch)
treecbd009edc7d86027d35219887c0b1cd7b0dfc9a4 /src/sql/models
parent78a6b807195b5dee50f5f6b2e1a86f49af60cb39 (diff)
Doc: Fix QSql*Model snippets
- QSqlQueryModel docs contained a snippet about QSqlTableModel. - Snippet #25 was about QSqlTableModel, but it was previously unused. - This patch ensures that snippet code matches the corresponding text descriptions. Change-Id: I2a5ffbe0978ef9b8d0b027db59647b824e52d214 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'src/sql/models')
-rw-r--r--src/sql/models/qsqlquerymodel.cpp4
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp
index c0b1061c6b..31d0ec985d 100644
--- a/src/sql/models/qsqlquerymodel.cpp
+++ b/src/sql/models/qsqlquerymodel.cpp
@@ -124,8 +124,8 @@ int QSqlQueryModelPrivate::columnInQuery(int modelColumn) const
\snippet sqldatabase/sqldatabase.cpp 21
The code snippet above extracts the \c salary field from record 4 in
- the result set of the query \c{SELECT * from employee}. Assuming
- that \c salary is column 2, we can rewrite the last line as follows:
+ the result set of the \c SELECT query. Since \c salary is the 2nd
+ column (or column index 1), we can rewrite the last line as follows:
\snippet sqldatabase/sqldatabase.cpp 22
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 4bc9a8c2f8..969194983e 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -222,7 +222,7 @@ bool QSqlTableModelPrivate::exec(const QString &stmt, bool prepStatement,
QSqlTableModel can also be used to access a database
programmatically, without binding it to a view:
- \snippet sqldatabase/sqldatabase.cpp 21
+ \snippet sqldatabase/sqldatabase.cpp 25
The code snippet above extracts the \c salary field from record 4 in
the result set of the query \c{SELECT * from employee}.