PySide6.QtPositioning.QGeoLocation¶
- class QGeoLocation¶
- The - QGeoLocationclass represents basic information about a location. More…- Synopsis¶- Methods¶- def - __init__()
- def - address()
- def - boundingShape()
- def - coordinate()
- def - isEmpty()
- def - __ne__()
- def - __eq__()
- def - setAddress()
- def - setCoordinate()
- 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¶- A - QGeoLocationconsists of a coordinate and corresponding address, along with an optional bounding shape, which is the recommended region to be displayed when viewing the location.- __init__()¶
 - Constructs an new location object. - __init__(other)
- Parameters:
- other – - QGeoLocation
 
 - Constructs a copy of - other- address()¶
- Return type:
 
 - Returns the address of the location. - See also - Returns a bounding shape which represents the recommended region to display when viewing this location. - For example, a building’s location may have a region centered around the building, but the region is large enough to show it’s immediate surrounding geographical context. - Note - This method was introduced in Qt6 instead of boundingBox() method. It returns a - QGeoShapeinstead of a- QGeoRectangle. Use- boundingGeoRectangle()to obtain a bounding- QGeoRectanglefor the shape.- See also - coordinate()¶
- Return type:
 
 - Returns the coordinate of the location. - See also - extendedAttributes()¶
- Return type:
- Dictionary with keys of type .QString and values of type QVariant. 
 
 - Returns the extended attributes associated to this location. Extended attributes are backend-dependent and can be location-dependent. - See also - isEmpty()¶
- Return type:
- bool 
 
 - Returns - trueif the location coordinate is- invalid, and all the other location fields are empty. Otherwise returns- false.- __ne__(rhs)¶
- Parameters:
- rhs – - QGeoLocation
- Return type:
- bool 
 
 - Returns - trueif the- lhslocation is not equal to- rhs, otherwise returns- false.- __eq__(rhs)¶
- Parameters:
- rhs – - QGeoLocation
- Return type:
- bool 
 
 - Returns - trueif the- lhslocation is equal to- rhs, otherwise returns- false.- setAddress(address)¶
- Parameters:
- address – - QGeoAddress
 
 - Sets the - addressof the location.- See also - Sets the - boundingShapeof the location.- See also - setCoordinate(position)¶
- Parameters:
- position – - QGeoCoordinate
 
 - Sets the - coordinateof the location.- See also - setExtendedAttributes(data)¶
- Parameters:
- data – Dictionary with keys of type .QString and values of type QVariant. 
 
 - Sets the extended attributes of the location with the parameters specified in - data.- See also - swap(other)¶
- Parameters:
- other – - QGeoLocation
 
 - Swaps this location with - other. This operation is very fast and never fails.