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
QBluetoothPermission Class Reference

Access Bluetooth peripherals. More...

#include <qpermissions.h>

+ Collaboration diagram for QBluetoothPermission:

Public Types

enum  CommunicationMode : quint8 { Access = 0x01 , Advertise = 0x02 , Default = Access | Advertise }
 

Public Member Functions

Q_CORE_EXPORT void setCommunicationModes (CommunicationModes modes)
 
Q_CORE_EXPORT CommunicationModes communicationModes () const
 

Detailed Description

Access Bluetooth peripherals.

Definition at line 177 of file qpermissions.h.

Member Enumeration Documentation

◆ CommunicationMode

Since
6.6

This enum is used to control the allowed Bluetooth communication modes.

\value Access Allow this device to access other Bluetooth devices. This includes scanning for nearby devices and connecting to them. \value Advertise Allow other Bluetooth devices to discover this device. \value Default This configuration is used by default.

Note
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 \l {QLocationPermission::Precise}{precise location} permission. This permission coupling may change in the future.
Enumerator
Access 
Advertise 
Default 

Definition at line 181 of file qpermissions.h.

Member Function Documentation

◆ communicationModes()

QBluetoothPermission::CommunicationModes QBluetoothPermission::communicationModes ( ) const
Since
6.6

Returns the allowed Bluetooth communication modes.

Definition at line 433 of file qpermissions.cpp.

Referenced by nativeBluetoothPermission().

+ Here is the caller graph for this function:

◆ setCommunicationModes()

void QBluetoothPermission::setCommunicationModes ( CommunicationModes modes)
Since
6.6

Sets the allowed Bluetooth communication modes to modes.

Note
A default-constructed instance of \l {QBluetoothPermission::} {CommunicationModes} has no sense, so an attempt to set such a mode will raise a {qWarning()} and fall back to using the \l {QBluetoothPermission::}{Default} mode.

Definition at line 417 of file qpermissions.cpp.

References Default, and qCWarning.

Referenced by ensureAndroidPermission().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: