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 Functions

bool isReadWrite() const
void setReadWrite(bool enable)

Detailed Description

By default the request is for read-only access. Use setReadWrite() 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::isReadWrite() is set to true.

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 Function Documentation

bool QCalendarPermission::isReadWrite() const

Returns true when the request is for read-write and false when it is for read-only access to the calendar.

void QCalendarPermission::setReadWrite(bool enable)

Sets whether the request is for read-write (enable == true) or read-only (enable == false) access to the calendar.

See also isReadWrite().