Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qt6-changes.qdoc
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page qtsql-changes-qt6.html
6 \title Changes to Qt SQL
7 \ingroup changes-qt-5-to-6
8 \brief The return type for boundValues() has been changed in QSqlQuery class.
9
10 Qt 6 is a result of the conscious effort to make the framework more
11 efficient and easy to use.
12
13 We try to maintain binary and source compatibility for all the public
14 APIs in each release. But some changes were inevitable in an effort to
15 make Qt a better framework.
16
17 In this topic we summarize those changes in Qt SQL, and provide guidance
18 to handle them.
19
20 \section1 The QSqlQuery class
21
22 \section2 boundValues() Signature
23
24 The return type for boundValues() has been changed from QMap<QString, QVariant>
25 to a QVariantList. The order can be relied upon so it will be in the order of the
26 binding in the prepared query. Change code like the following:
27
28 \code
29 QMap<QString, QVariant> values = boundValues();
30 int id = values[":id"].value().toInt();
31 \endcode
32
33 \code
34 QList<QVariant> values = boundValues().values();
35 int id = values.at(0).toInt();
36 \endcode
37
38 to:
39
40 \code
41 QList<QVariant> values = boundValues().values();
42 int id = values.at(0).toInt();
43 \endcode
44*/