PySide6.QtCore.QLocationPermission¶
- class QLocationPermission¶
Access the user’s location. More…
Added in version 6.5.
Synopsis¶
Methods¶
def
__init__()def
accuracy()def
availability()def
setAccuracy()def
swap()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
By default the request is for approximate accuracy, and only while the application is in use. Use
setAccuracy()and/orsetAvailability()to override the default.Requirements¶
To request this permission at runtime, the following platform specific usage declarations have to be made at build time:
Platform
Type
macOS
NSLocationUsageDescriptioniOS
NSLocationWhenInUseUsageDescription, andNSLocationAlwaysAndWhenInUseUsageDescriptionif requestingAlwaysAndroid
uses-permission:ref:` <Application-Permissions>`android.permission.ACCESS_FINE_LOCATIONforPreciseandroid.permission.ACCESS_COARSE_LOCATIONforApproximateandroid.permission.ACCESS_BACKGROUND_LOCATIONforAlways
Note
Alwaysuses-permissionstring has to be combined with one or both ofPreciseandApproximatestrings.Please see the individual usage declaration types for how to add them to your project.
- class Accuracy¶
This enum is used to control the accuracy of the location data.
Constant
Description
QLocationPermission.Accuracy.Approximate
An approximate location is requested.
QLocationPermission.Accuracy.Precise
A precise location is requested.
- class Availability¶
This enum is used to control the availability of the location data.
Constant
Description
QLocationPermission.Availability.WhenInUse
The location is only available only when the application is in use.
QLocationPermission.Availability.Always
The location is available at all times, including when the application is in the background.
- __init__()¶
- __init__(other)
- Parameters:
other –
QLocationPermission
Returns the accuracy of the request.
See also
- availability()¶
- Return type:
Returns the availability of the request.
See also
Sets the desired
accuracyof the request.See also
- setAvailability(availability)¶
- Parameters:
availability –
Availability
Sets the desired
availabilityof the request.See also
- swap(other)¶
- Parameters:
other –
QLocationPermission