8#include <QtCore/qshareddata.h>
9#include <QtCore/qdebug.h>
269const void *QPermission::data(
QMetaType requestedType)
const
271 const auto actualType =
type();
272 if (requestedType != actualType)
274 return m_data.
data();
281#define QT_PERMISSION_IMPL_COMMON(ClassName) \
283 static_assert(sizeof(ClassName) == sizeof(void*), \
284 "You have added too many members to " #ClassName "::ShortData. " \
285 "Decrease their size or switch to using a d-pointer."); \
286 static_assert(alignof(ClassName) == alignof(AlignmentCheck), \
287 "You have added members to " #ClassName "::ShortData that are overaligned. " \
288 "Decrease their alignment or switch to using a d-pointer."); \
289 ClassName::ClassName(const ClassName &other) noexcept = default; \
290 ClassName::~ClassName() = default; \
291 ClassName &ClassName::operator=(const ClassName &other) noexcept = default; \
292 ClassName::ClassName() \
419 if (modes == CommunicationModes{}) {
420 qCWarning(lcPermissions,
"QBluetoothPermission: trying to set an invalid empty mode. "
421 "Falling back to CommunicationMode::Default.");
477 : u{
ShortData{Accuracy::Approximate, Availability::WhenInUse, {}}}
513 return u.data.accuracy;
529 return u.data.availability;
652#ifndef QT_NO_DEBUG_STREAM
655 const auto verbosity =
debug.verbosity();
657 debug.nospace().setVerbosity(0);
658 if (verbosity >= QDebug::DefaultVerbosity)
661 if (verbosity >= QDebug::DefaultVerbosity)
667#undef QT_PERMISSION_IMPL_COMMON
669#if !defined(Q_OS_DARWIN) && !defined(Q_OS_ANDROID) && !defined(Q_OS_WASM)
677 qCDebug(lcPermissions) <<
"No permission backend on this platform."
678 <<
"Optimistically returning Granted for" << permission;
684 qCDebug(lcPermissions) <<
"No permission backend on this platform."
685 <<
"Optimistically returning Granted for" << permission;
693#include "moc_qpermissions.cpp"
Access Bluetooth peripherals.
Q_CORE_EXPORT CommunicationModes communicationModes() const
Q_CORE_EXPORT void setCommunicationModes(CommunicationModes modes)
Access the user's calendar.
Q_CORE_EXPORT void setAccessMode(AccessMode mode)
Sets whether the request is for read-write (mode == AccessMode::ReadOnly) or read-only (mode == Acces...
Q_CORE_EXPORT AccessMode accessMode() const
Returns AccessMode::ReadWrite when the request is for read-write and AccessMode::ReadOnly when it is ...
AccessMode
This enum is used to control access to the calendar data.
Access the camera for taking pictures or videos.
Access the user's location.
Availability
This enum is used to control the availability of the location data.
Q_CORE_EXPORT void setAvailability(Availability availability)
Sets the desired availability of the request.
Q_CORE_EXPORT void setAccuracy(Accuracy accuracy)
Sets the desired accuracy of the request.
Accuracy
This enum is used to control the accuracy of the location data.
Q_CORE_EXPORT Availability availability() const
Returns the availability of the request.
Q_CORE_EXPORT Accuracy accuracy() const
Returns the accuracy of the request.
Access the microphone for monitoring or recording sound.
virtual ~QPermissionPlugin()
\inmodule QtCore \inheaderfile QPermissions
QMetaType type() const
Returns the type of the permission.
Qt::PermissionStatus status() const
Returns the status of the permission.
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
void requestPermission(const QPermission &permission, const PermissionCallback &callback)
std::function< void(Qt::PermissionStatus)> PermissionCallback
Qt::PermissionStatus checkPermission(const QPermission &permission)
Combined button and popup list for selecting options.
QDateTimePrivate::QDateTimeShortData ShortData
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
#define QT_PERMISSION_IMPL_COMMON(ClassName)
QDebug operator<<(QDebug debug, const QPermission &permission)
static QT_BEGIN_NAMESPACE const uint Default