- class QGeoCircle#
QGeoCircle类定义一个圆形地理区域。 更多…摘要#
属性#
方法#
def
__init__()def
extendCircle()def
radius()def
setCenter()定义
setRadius()定义
translate()定义
translated()
注意
本文档可能包含自动从C++转换为Python的片段。我们始终欢迎对片段翻译的贡献。如果您发现翻译存在问题,也可以通过在https:/bugreports.qt.io/projects/PYSIDE上创建工单的方式来告知我们。
详细描述#
该圆形由一个指定圆心的
QGeoCoordinate和一个表示圆的半径(单位:米)的qreal定义。如果中心坐标无效或半径小于零,则认为圆形无效。
自Qt 5.5起,此类是Q_GADGET。它可以直接从C++和QML中使用。
注意
当使用
from __feature__ import true_property时可以直接使用属性,否则通过访问函数来使用。- 属性center: QGeoCoordinate#
该属性包含地理圆形的中心坐标。
如果此属性包含无效坐标,则圆形被认为是无效的。
默认构造的
QGeoCircle使用无效的QGeoCoordinate作为中心。虽然此属性是在Qt 5.5中引入的,但相关的访问函数在类的第一个版本就存在了。
- 访问函数
- 属性radius: float#
该属性包含圆的半径(单位:米)。
如果此属性为负,则圆形被认为是无效的。
默认情况下,半径初始化为
-1。虽然此属性是在Qt 5.5中引入的,但相关的访问函数在类的第一个版本就存在了。
- 访问函数
- __init__()#
构造一个新无效的地理圆形。
- __init__(other)
- 参数:
other –
QGeoCircle
从
other的内容中构建一个新的地理圆。- __init__(center[, radius=-1.0])
- 参数:
center –
QGeoCoordinateradius – float
构建一个新的地理圆,其中心为
center且半径为radius米。- __init__(other)
- 参数:
other –
QGeoShape
从
other的内容中构建一个新的地理圆。- extendCircle(coordinate)#
- 参数:
coordinate –
QGeoCoordinate
扩展地理圆,使其覆盖坐标
coordinate- radius()#
- 返回类型:
float
返回此地理圆的半径(以米为单位)。
另请参阅
属性
radiusᅟ的获取器。- setCenter(center)#
- 参数:
center –
QGeoCoordinate
将此地理圆的中心坐标设置为
center。另请参阅
center()属性
centerᅟ的设置器。- setRadius(radius)#
- 参数:
radius – float
将此地理圆的半径(以米为单位)设置为
radius。另请参阅
属性
radiusᅟ的设置器。- translate(degreesLatitude, degreesLongitude)#
- 参数:
degreesLatitude – float
degreesLongitude – float
将此地理圆沿经度
degreesLongitude东移和纬度degreesLatitude北移。纬度
degreesLatitude和经度degreesLongitude的负值分别对应向南和向西平移。- 已翻译(degreesLatitude, degreesLongitude)#
- 参数:
degreesLatitude – float
degreesLongitude – float
- 返回类型:
返回一个新的地理圆圈副本,该副本通过向北极方向移动
degreesLatitude和向东方向移动degreesLongitude来平移。纬度
degreesLatitude和经度degreesLongitude的负值分别对应向南和向西平移。另请参阅