QContactsPermission Class▲
-
Header: QPermissions
-
Since: Qt 6.5
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
-
qmake: QT += core
-
Group: QContactsPermission is part of permissions
I. Detailed Description▲
By default the request is for read-only access. Use setAccessMode() to override the default.
I-1. Requirements▲
To request this permission at runtime, the following platform specific usage declarations have to be made at build time:
Platform |
Type |
|
---|---|---|
Apple |
NSContactsUsageDescription |
|
Android |
android.permission.READ_CONTACTS. android.permission.WRITE_CONTACTS if QContactsPermission::accessMode() is set to AccessMode::ReadWrite. |
Please see the individual usage declaration types for how to add them to your project.
I-2. See Also▲
II. Member Type Documentation▲
II-1. enum QContactsPermission::AccessMode▲
This enum is used to control access to the contacts data.
Constant |
Value |
Description |
---|---|---|
QContactsPermission::ReadOnly |
0 |
Read-only access to the contacts data (the default). |
QContactsPermission::ReadWrite |
1 |
Read and write access to the contacts data. |
II-1-1. See Also▲
See also setAccessMode, accessMode
III. Member Function Documentation▲
III-1. QContactsPermission::AccessMode QContactsPermission::accessMode() const▲
Returns AccessMode::ReadWrite when the request is for read-write and AccessMode::ReadOnly when it is for read-only access to the contacts.
III-1-1. See Also▲
See also setAccessMode()
III-2. void QContactsPermission::setAccessMode(QContactsPermission::AccessMode mode)▲
Sets whether the request is for read-write (mode == AccessMode::ReadOnly) or read-only (mode == AccessMode::ReadOnly) access to the contacts.
III-2-1. See Also▲
See also accessMode()