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) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page qtbluetooth-changes-qt6.html
6 \title Changes to Qt Bluetooth
7 \ingroup changes-qt-5-to-6
8 \brief Migrate QtBluetooth to Qt 6.
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 QtBluetooth, and provide guidance
18 to handle them.
19
20 \section1 General
21
22 \list
23 \li qbluetoothglobal.h was removed. qtbluetoothglobal.h is the official header with the same purpose.
24
25 \li Every usage of QVector has been replaced by QList.
26
27 \li Win32 backend has been removed. There will not be a working Bluetooth backend when Qt is built with mingw.
28
29 \li Since there is now only one Windows backend, the logging category qt.bluetooth.winrt was removed.
30 The corresponding log messages are now in qt.bluetooth.windows.
31 \endlist
32
33 \section1 QBluetooth namespace
34
35 The enums QBluetooth::Security and QBluetooth::AttAccessConstraint have been changed
36 to a scoped enums for improved type safety.
37
38 \section1 QBluetoothDeviceDiscoveryAgent
39
40 QBluetoothDeviceDiscoveryAgent::inquiryType property and related setter/getter & enum were removed.
41 The API element was never implemented and/or supported.
42
43 \section1 QBluetoothDeviceInfo
44
45 \list
46 \li manufacturerData() returns a QMultiHash rather than QHash. Since Qt 6
47 QMultiHash is no longer derived from QHash.
48
49 \li DataCompleteness was removed without replacement as the related API elements
50 no longer served a purpose
51
52 \li setServiceUuids(const QList<QBluetoothUuid>, DataCompleteness) was replaced by
53 setServiceUuids(const QList<QBluetoothUuid> &uuids)
54
55 \li DataCompleteness serviceUuidsCompleteness() const was removed without replacement.
56
57 \li QList<QBluetoothUuid> serviceUuids(DataCompleteness *completeness = nullptr) const was replaced by
58 QList<QBluetoothUuid> serviceUuids() const.
59 \endlist
60
61 \section1 QBluetoothLocalDevice
62
63 The pairing agent related API was removed without replacement. This includes pairingConfirmation(bool),
64 pairingDisplayPinCode(..) & pairingDisplayConfirmation(..). Except for Android and BlueZ 4 there was
65 never an implementation for it. Bluez 4 support was removed in Qt 6 and Android's implementation
66 required unobtainable BLUETOOTH_PRIVILEGED for at least parts of the code.
67
68 \section1 QLowEnergyService
69
70 Renamed ServiceState enum values:
71 \list
72 \li \l{QLowEnergyService::DiscoveryRequired}{DiscoveryRequired} becomes \l{QLowEnergyService::RemoteService}{RemoteService}
73 \li \l{QLowEnergyService::DiscoveringService}{DiscoveringService} becomes \l{QLowEnergyService::RemoteServiceDiscovering}{RemoteServiceDiscovering}
74 \li \l{QLowEnergyService::ServiceDiscovered}{ServiceDiscovered} becomes \l{QLowEnergyService::RemoteServiceDiscovered}{RemoteServiceDiscovered}
75 \endlist
76 This change happens in anticipation that service discovery might become an optional
77 step in the future.
78
79 \section1 QBluetoothUuid
80
81 enums \l{QBluetoothUuid::ProtocolUuid}{ProtocolUuid},
82 \l{QBluetoothUuid::ServiceClassUuid}{ServiceClassUuid},
83 \l{QBluetoothUuid::CharacteristicType}{CharacteristicType}, and
84 \l{QBluetoothUuid::DescriptorType}{DescriptorType} are now scoped enums.
85 The usage of enum items has to be adapted in user code.
86
87 \section1 QLowEnergyController
88
89 \list
90 \li Existing ctors and create*() functions with remote QBluetoothAddress parameters have been removed. QBluetoothAddress
91 is not sufficient to indicate remote devices on Apple systems. It requires UUIDs to "name" devices. This can only
92 be satisfied by QBluetoothDeviceInfo.
93
94 \li Remaining QLowEnergyController ctors have been made private. The createPeripheral() and createCentral() functions
95 should be used to obtain QLowEnergyController instances.
96 \endlist
97
98 \section1 QLowEnergyCharacteristic
99
100 \list
101 \li The new method clientCharacteristicConfiguration() has been introduced to conveniently obtain the
102 Client Characteristic Configuration Descriptor.
103 \li The constants
104 \l{QLowEnergyCharacteristic::CCCDDisable}{CCCDDisable},
105 \l{QLowEnergyCharacteristic::CCCDEnableNotification}{CCCDEnableNotification}, and
106 \l{QLowEnergyCharacteristic::CCCDEnableIndication}{CCCDEnableIndication} have been introduced
107 which hold the possible values for the Client Characteristic Configuration Descriptor.
108 \li The handle() method is no longer part of the public Bluetooth LE interfaces. It's purpose as identifier
109 for characteristics was replaced. The QLowEnergyCharacteristic instances itself serve as identifier.
110 \endlist
111
112 \section1 QLowEnergyDescriptor
113
114 The handle() method is no longer part of the public Bluetooth LE interfaces. It's purpose as identifier
115 for descriptors was replaced. The QLowEnergyDescriptor instances itself serve as identifier.
116
117 \section1 QBluetoothTransferManager
118
119 QBluetoothTransferManager, QBluetoothTransferRequest, and QBluetoothTransferReply have been removed
120 without replacement.
121
122 \section1 QBluetoothSocket
123
124 QBluetoothSocket::SocketState and QBluetoothSocket::SocketError are now scoped enums. The usage of enum
125 items has to be adapted in user code.
126
127 \section1 QML Interface
128
129 The QML interface has been removed because socket programming via QML is not advisable.
130 QDeclarativeBluetoothService, QDeclarativeBluetoothSocket, and QDeclarativeBluetoothDiscoveryModel
131 (in QML: BluetoothService, BluetoothSocket, and BluetoothDiscoveryModel)
132 have been removed without replacement.
133
134 \section1 "error" signals
135
136 The "error" signals in QBluetoothDeviceDiscoveryAgent, QBluetoothLocalDevice, QBluetoothServer,
137 QBluetoothServiceDiscoveryAgent, QBluetoothSocket, QLowEnergyController, and QLowEnergyService
138 have been renamed to "errorOccurred" to remove ambiguities between the "error" signal and the
139 "error" getter.
140
141*/