Qt Bluetooth enables connectivity between Bluetooth enabled devices.
The Bluetooth API provides connectivity between Bluetooth enabled devices.
Currently, the API is supported on the following platforms:
Linux (BlueZ 5.x)
Qt for Windows
Bluetooth LE Central
Bluetooth LE Peripheral
Bluetooth LE Advertisement & Scanning
Qt 5.14 adds a native Win32 port supporting Classic Bluetooth on Windows 7 or newer, and Bluetooth LE on Windows 8 or newer. It must be enabled at build time by configuration option -native-win32-bluetooth. The UWP backend is used by default if this option is not set and the Win32 target platform supports the required UWP APIs (minimal requirement is Windows 10 version 1507, with slightly improved service discovery since Windows 10 version 1607).
Bluetooth is a short-range (less than 100 meters) wireless technology. It has a reasonably high data transfer rate of 2.1 Mbit/s, which makes it ideal for transferring data between devices. Bluetooth connectivity is based on basic device management, such as scanning for devices, gathering information about them, and exchanging data between them.
Qt Bluetooth supports Bluetooth Low Energy development for client/central role use cases. Further details can be found in the Bluetooth Low Energy Overview section.
Using the Module#
To include the definitions of modules classes, use the following directive:
The Bluetooth API on macOS requires a certain type of event dispatcher that in
Qt causes a dependency to
QGuiApplication . However, you can set
the environment variable
circumvent this issue.
Applications that don’t use Classic Bluetooth will find a subset of
QtBluetooth is available,
as CoreBluetooth (Bluetooth LE) do not require either of
The QtBluetooth module
exports the following
logging categories :
Enables logging of cross platform code path in QtBluetooth
Enables logging of the Android implementation
Enables logging of the BLuez/Linux implementation
Enables logging of the iOS implementation
Enables logging of the macOS implementation
Enables logging of the Qt for Windows implementation
Logging categories can be used to enable additional warning and debug output
for QtBluetooth . More
detailed information about logging can be found in
QLoggingCategory . A quick way to enable all
QtBluetooth logging is to
add the following line to the
QLoggingCategory.setFilterRules("qt.bluetooth* = true")
List of Classes#