Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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.
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 442 of file qpermissions.cpp.

◆ 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 426 of file qpermissions.cpp.


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