Access Bluetooth peripherals. More…
New in version 6.5.
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
To request this permission at runtime, the following platform specific usage declarations have to be made at build time:
Up to Android 11 (API Level < 31):
Starting from Android 12 (API Level >= 31):
Please see the individual usage declaration types for how to add them to your project.
Currently on Android the
android.permission.ACCESS_FINE_LOCATION permission is requested together with Bluetooth permissions. This is required for Bluetooth to work properly, unless the application provides a strong assertion in the application manifest that it does not use Bluetooth to derive a physical location. This permission coupling may change in future.
- class PySide6.QtCore.QBluetoothPermission#
enum.Flag) This enum is used to control the allowed Bluetooth communication modes.
Allow this device to access other Bluetooth devices. This includes scanning for nearby devices and connecting to them.
Allow other Bluetooth devices to discover this device.
This configuration is used by default.
The fine-grained permissions are currently supported only on Android 12 and newer. On older Android versions, as well as on Apple operating systems, any mode results in full Bluetooth access.
For now the
Access mode on Android also requests the
precise location permission. This permission coupling may change in the future.
New in version 6.6.
- Return type:
Returns the allowed Bluetooth communication modes.
Sets the allowed Bluetooth communication modes to
A default-constructed instance of
CommunicationModes has no sense, so an attempt to set such a mode will raise a
qWarning() and fall back to using the