QCalendarPermission Class

Access the user's calendar. More...

Header: #include <QPermissions>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.5

Public Types

enum AccessMode { ReadOnly, ReadWrite }

Public Functions

QCalendarPermission::AccessMode accessMode() const
void setAccessMode(QCalendarPermission::AccessMode mode)

Detailed Description

By default the request is for read-only access. Use setAccessMode() to override the default.

Requirements

To request this permission at runtime, the following platform specific usage declarations have to be made at build time:

PlatformType
AppleUsage descriptionNSCalendarsUsageDescription
Androiduses-permissionandroid.permission.READ_CALENDAR. android.permission.WRITE_CALENDAR if QCalendarPermission::accessMode() is set to AccessMode::ReadWrite.

Please see the individual usage declaration types for how to add them to your project.

See also QPermission, QCoreApplication::requestPermission(), QCoreApplication::checkPermission(), and Application Permissions.

Member Type Documentation

enum QCalendarPermission::AccessMode

This enum is used to control access to the calendar data.

ConstantValueDescription
QCalendarPermission::ReadOnly0Read-only access to the calendar data (the default).
QCalendarPermission::ReadWrite1Read and write access to the calendar data.

See also setAccessMode and accessMode.

Member Function Documentation

QCalendarPermission::AccessMode QCalendarPermission::accessMode() const

Returns AccessMode::ReadWrite when the request is for read-write and AccessMode::ReadOnly when it is for read-only access to the calendar.

See also setAccessMode().

void QCalendarPermission::setAccessMode(QCalendarPermission::AccessMode mode)

Sets whether the request is for read-write (mode == AccessMode::ReadOnly) or read-only (mode == AccessMode::ReadOnly) access to the calendar.

See also accessMode().

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