![]() |
Qt 6.x
The Qt SDK
|
Access the user's location. More...
#include <qpermissions.h>
Public Types | |
enum | Accuracy : quint8 { Approximate , Precise } |
This enum is used to control the accuracy of the location data. More... | |
enum | Availability : quint8 { WhenInUse , Always } |
This enum is used to control the availability of the location data. More... | |
Public Member Functions | |
Q_CORE_EXPORT void | setAccuracy (Accuracy accuracy) |
Sets the desired accuracy of the request. | |
Q_CORE_EXPORT Accuracy | accuracy () const |
Returns the accuracy of the request. | |
Q_CORE_EXPORT void | setAvailability (Availability availability) |
Sets the desired availability of the request. | |
Q_CORE_EXPORT Availability | availability () const |
Returns the availability of the request. | |
Access the user's location.
By default the request is for approximate accuracy, and only while the application is in use. Use setAccuracy() and/or setAvailability() to override the default.
Definition at line 98 of file qpermissions.h.
This enum is used to control the accuracy of the location data.
\value Approximate An approximate location is requested. \value Precise A precise location is requested.
Enumerator | |
---|---|
Approximate | |
Precise |
Definition at line 102 of file qpermissions.h.
This enum is used to control the availability of the location data.
\value WhenInUse The location is only available only when the application is in use. \value Always The location is available at all times, including when the application is in the background.
Enumerator | |
---|---|
WhenInUse | |
Always |
Definition at line 111 of file qpermissions.h.
QLocationPermission::Accuracy QLocationPermission::accuracy | ( | ) | const |
Returns the accuracy of the request.
Definition at line 511 of file qpermissions.cpp.
Referenced by nativeLocationPermission(), and setAccuracy().
QLocationPermission::Availability QLocationPermission::availability | ( | ) | const |
Returns the availability of the request.
Definition at line 527 of file qpermissions.cpp.
Referenced by nativeLocationPermission(), and setAvailability().
Sets the desired accuracy of the request.
Definition at line 503 of file qpermissions.cpp.
References accuracy().
Referenced by AndroidPositioning::hasPositioningPermissions().
void QLocationPermission::setAvailability | ( | Availability | availability | ) |
Sets the desired availability of the request.
Definition at line 519 of file qpermissions.cpp.
References availability().
Referenced by AndroidPositioning::hasPositioningPermissions().