PySide6.QtPositioning.QGeoPositionInfo¶
- class QGeoPositionInfo¶
- The - QGeoPositionInfoclass contains information gathered on a global position, direction and velocity at a particular point in time. More…- Synopsis¶- Methods¶- def - __init__()
- def - attribute()
- def - coordinate()
- def - hasAttribute()
- def - isValid()
- def - __ne__()
- def - __eq__()
- def - setAttribute()
- def - setCoordinate()
- def - setTimestamp()
- def - swap()
- def - timestamp()
 - 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¶- A - QGeoPositionInfocontains, at a minimum, a geographical coordinate and a timestamp. It may also have heading and speed measurements as well as estimates of the accuracy of the provided data.- See also - class Attribute¶
- Defines the attributes for positional information. - Constant - Description - QGeoPositionInfo.Direction - The bearing measured in degrees clockwise from true north to the direction of travel. - QGeoPositionInfo.GroundSpeed - The ground speed, in meters/sec. - QGeoPositionInfo.VerticalSpeed - The vertical speed, in meters/sec. - QGeoPositionInfo.MagneticVariation - The angle between the horizontal component of the magnetic field and true north, in degrees. Also known as magnetic declination. A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction. - QGeoPositionInfo.HorizontalAccuracy - The accuracy of the provided latitude-longitude value, in meters. - QGeoPositionInfo.VerticalAccuracy - The accuracy of the provided altitude value, in meters. - QGeoPositionInfo.DirectionAccuracy - The accuracy of the provided bearing, in degrees. This attribute is available only on Android (API level 26 or above) and macOS/iOS. See corresponding Android and Apple documentation for more details. - NMEA protocol also suggests another type of accuracy - PositionAccuracy, which is a 3D accuracy value. Qt does not provide a separate attribute for it. If you need this value, you can calculate it based on the following formula: - PositionAccuracy2- = HorizontalAccuracy2- + VerticalAccuracy2
 - __init__()¶
 - Creates an invalid - QGeoPositionInfoobject.- See also - __init__(other)
- Parameters:
- other – - QGeoPositionInfo
 
 - Creates a - QGeoPositionInfowith the values of- other.- __init__(coordinate, updateTime)
- Parameters:
- coordinate – - QGeoCoordinate
- updateTime – - QDateTime
 
 
 - Creates a - QGeoPositionInfofor the given- coordinateand- timestamp.- Returns the value of the specified - attributeas a qreal value.- Returns NaN if the value has not been set. - The function - hasAttribute()should be used to determine whether or not a value has been set for an attribute.- See also - coordinate()¶
- Return type:
 
 - Returns the coordinate for this position. - Returns an invalid coordinate if no coordinate has been set. - See also - Returns true if the specified - attributeis present for this- QGeoPositionInfoobject.- isValid()¶
- Return type:
- bool 
 
 - Returns true if the - timestamp()and- coordinate()values are both valid.- __ne__(rhs)¶
- Parameters:
- rhs – - QGeoPositionInfo
- Return type:
- bool 
 
 - Returns - trueif any of the- lhsobject’s values are not the same as those of- rhs. Otherwise returns- false.- __eq__(rhs)¶
- Parameters:
- rhs – - QGeoPositionInfo
- Return type:
- bool 
 
 - Returns - trueif all of the- lhsobject’s values are the same as those of- rhs. Otherwise returns- false.- Removes the specified - attributeand its value.- Sets the value for - attributeto- value.- See also - setCoordinate(coordinate)¶
- Parameters:
- coordinate – - QGeoCoordinate
 
 - Sets the coordinate for this position to - coordinate.- See also - Sets the date and time at which this position was reported to - timestamp.- The - timestampmust be in UTC time.- See also - swap(other)¶
- Parameters:
- other – - QGeoPositionInfo
 
 - Swaps this position information with - other. This operation is very fast and never fails.- Returns the date and time at which this position was reported, in UTC time. - Returns an invalid QDateTime if no date/time value has been set. - See also