From 6a7a4aac0a94650247d8578475a8725009d7d569 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sun, 17 Nov 2019 00:11:21 +0100 Subject: Doc: add warning for binding values in QSqlQuery Not all SQL operations support binding values like the PRAGMA instruction of SQLite. This patch adds a warning for the developer to make it clearer that binding values cannot be used for everything. Task-number: QTBUG-80082 Change-Id: Ie1d33815d74a0759a3593df9410b8bad448f6fe9 Reviewed-by: Sze Howe Koh --- src/sql/kernel/qsqlquery.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sql') diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index e7c444f5b9..34a3ba3755 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -182,6 +182,9 @@ QSqlQueryPrivate::~QSqlQueryPrivate() You can retrieve the values of all the fields in a single variable (a map) using boundValues(). + \note Not all SQL operations support binding values. Refer to your database + system's documentation to check their availability. + \section1 Approaches to Binding Values Below we present the same example using each of the four -- cgit v1.2.3 From af2daafde72db02454d24b7d691aa6861525ab99 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 18 Nov 2019 17:01:26 +0100 Subject: Deprecate constructing QFlags from a pointer This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira --- src/sql/models/qsqltablemodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sql') diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index ba8a6dea36..4b29492134 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -1305,7 +1305,7 @@ Qt::ItemFlags QSqlTableModel::flags(const QModelIndex &index) const Q_D(const QSqlTableModel); if (index.internalPointer() || index.column() < 0 || index.column() >= d->rec.count() || index.row() < 0) - return 0; + return { }; bool editable = true; -- cgit v1.2.3