PySide6.QtPositioning.QGeoLocation¶
- class QGeoLocation¶
QGeoLocation类表示关于位置的基本信息。更多…概要¶
方法¶
def
__init__()def
address()def
boundingShape()def
coordinate()def
isEmpty()def
__ne__()def
__eq__()def
setAddress()def
setCoordinate()def
swap()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
一个
QGeoLocation由一个坐标和相应的地址组成,还包括一个可选的边界形状,这是在查看位置时建议显示的区域。- __init__()¶
构造一个新的位置对象。
- __init__(other)
- Parameters:
其他 –
QGeoLocation
构造一个
other的副本- address()¶
- Return type:
返回位置的地址。
另请参阅
返回一个边界形状,表示在查看此位置时建议显示的区域。
例如,建筑物的位置可能有一个以建筑物为中心的区域,但该区域足够大,可以显示其周围的地理环境。
注意
该方法在Qt6中引入,取代了boundingBox()方法。它返回一个
QGeoShape而不是QGeoRectangle。使用boundingGeoRectangle()来获取形状的边界QGeoRectangle。另请参阅
- coordinate()¶
- Return type:
返回位置的坐标。
另请参阅
- extendedAttributes()¶
- Return type:
字典的键类型为 .QString,值类型为 QVariant。
返回与此位置关联的扩展属性。扩展属性依赖于后端,并且可能依赖于位置。
- isEmpty()¶
- Return type:
布尔
如果位置坐标是
无效的,并且所有其他位置字段为空,则返回true。否则返回false。- __ne__(rhs)¶
- Parameters:
rhs –
QGeoLocation- Return type:
布尔
如果
lhs位置不等于rhs,则返回true,否则返回false。- __eq__(rhs)¶
- Parameters:
rhs –
QGeoLocation- Return type:
布尔
如果
lhs位置等于rhs,则返回true,否则返回false。- setAddress(address)¶
- Parameters:
地址 –
QGeoAddress
设置位置的
address。另请参阅
设置位置的
boundingShape。另请参阅
- setCoordinate(position)¶
- Parameters:
位置 –
QGeoCoordinate
设置位置的
coordinate。另请参阅
- setExtendedAttributes(data)¶
- Parameters:
data – 字典,键类型为 .QString,值类型为 QVariant。
使用
data中指定的参数设置位置的扩展属性。另请参阅
- swap(other)¶
- Parameters:
其他 –
QGeoLocation