QBluetoothPermission Class
블루투스 주변 기기에 연결하기. 더 보기...
| 헤더: | #include <QPermissions> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 다음부터: | Qt 6.5부터 |
공개 유형
(since 6.6) enum | CommunicationMode { Access, Advertise, Default } |
| flags | CommunicationModes |
공개 함수
(since 6.6) QBluetoothPermission::CommunicationModes | communicationModes() const |
(since 6.6) void | setCommunicationModes(QBluetoothPermission::CommunicationModes modes) |
상세 설명
필수 조건
런타임에 이 권한을 요청하려면, 빌드 시점에 다음 플랫폼별 사용 선언을 수행해야 합니다:
| 플랫폼 | 유형 | |
|---|---|---|
| Apple | 사용법 설명 | NSBluetoothAlwaysUsageDescription |
| Android | uses-permission | Android 11 이하 (API 레벨 < 31):
Android 12(API 레벨 >= 31)부터:
|
프로젝트에 이를 추가하는 방법은 개별 사용 선언 유형을 참조하십시오.
참고: Qt 6.8.1부터 API 레벨이 31 이상인 경우 ACCESS_FINE_LOCATION 권한이 더 이상 요청되지 않습니다. 이로 인해 일부 블루투스 스캔 결과가 제한될 수 있습니다. 이러한 결과가 필요한 사용자는 위치 권한을 별도로 요청해야 하며( precise location 참조), BLUETOOTH_SCAN 권한에 android:usesPermissionFlags="neverForLocation" 속성이 설정되어 있지 않은지 확인해야 합니다. 애플리케이션 매니페스트에서 권한을 설정하고 사용자 정의하는 방법은 이 가이드를 참조하십시오.
또한 QPermission, QCoreApplication::requestPermission(), QCoreApplication::checkPermission(), 애플리케이션 권한을참조하십시오 .
멤버 유형 문서
[since 6.6] enum QBluetoothPermission::CommunicationMode
flags QBluetoothPermission::CommunicationModes
이 열거형은 허용되는 블루투스 통신 모드를 제어하는 데 사용됩니다.
| 상수 | 값 | 설명 |
|---|---|---|
QBluetoothPermission::Access | 0x01 | 이 장치가 다른 블루투스 장치에 액세스할 수 있도록 허용합니다. 여기에는 주변 장치 스캔 및 연결이 포함됩니다. |
QBluetoothPermission::Advertise | 0x02 | 다른 블루투스 장치가 이 장치를 검색할 수 있도록 허용합니다. |
QBluetoothPermission::Default | Access | Advertise | 이 구성은 기본적으로 사용됩니다. 참고: 세분화된권한은 현재 Android 12 이상에서만 지원됩니다. 이전 Android 버전과 Apple 운영 체제에서는 어떤 모드를 선택하더라도 블루투스에 대한 전체 액세스 권한이 부여됩니다. |
이 열거형은 Qt 6.6에서 도입되었습니다.
CommunicationModes 유형은 QFlags<CommunicationMode>에 대한 typedef입니다. 이 유형은 CommunicationMode 값들의 OR 조합을 저장합니다.
멤버 함수 문서
[since 6.6] QBluetoothPermission::CommunicationModes QBluetoothPermission::communicationModes() const
허용되는 블루투스 통신 모드를 반환합니다.
이 함수는 Qt 6.6에서 도입되었습니다.
setCommunicationModes()도 참조하십시오 .
[since 6.6] void QBluetoothPermission::setCommunicationModes(QBluetoothPermission::CommunicationModes modes)
허용되는 블루투스 통신 모드를 ` modes`로 설정합니다.
참고: ` CommunicationModes `의 기본 생성된인스턴스는 의미가 없으므로, 이러한 모드를 설정하려고 시도하면 ` qWarning() ` 예외가 발생하며 ` Default ` 모드로 대체됩니다.
이 함수는 Qt 6.6에서 도입되었습니다.
communicationModes()도 참조하십시오 .
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.