qt_add_android_permission

Adds an Android permission to the target executable.

The command is defined in the Core component of the Qt6 package, which can be loaded like so:

find_package(Qt6 REQUIRED COMPONENTS Core)

This command was introduced in Qt 6.9.

Synopsis

qt_add_android_permission(target NAME <permission-name> [ATTRIBUTES <name1> <value1> ...])

If versionless commands are disabled, use qt6_add_android_permission() instead. It supports the same set of arguments as this command.

Description

The command adds an Android permission to the target executable. This can be used to define additional permissions, or overriding the default permissions set by Qt modules.

For further information on defining Android permissions, see Qt Permissions and Features.

Example

qt_add_executable(myapp
    // ...
)
qt_add_android_permission(myapp
    NAME android.permission.BLUETOOTH_SCAN
    ATTRIBUTES
        minSdkVersion 31
        usesPermissionFlags neverForLocation
)
qt_add_android_permission(myapp
    NAME android.permission.ACCESS_COARSE_LOCATION
)

© 2024 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.