PySide6.QtPositioning.QGeoCircle

class QGeoCircle

QGeoCircle 类定义了一个圆形的地理区域。更多

PySide6.QtPositioning.QGeoCircle 的继承图

概要

属性

  • centerᅟ - 此属性保存地理圆的中心坐标

  • radiusᅟ - 此属性表示圆的半径,单位为米

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

圆是通过一个QGeoCoordinate来定义的,它指定了圆的中心,以及一个qreal,它指定了圆的半径(以米为单位)。

如果圆心坐标无效或半径小于零,则认为圆无效。

这个类自 Qt 5.5 起是一个 Q_GADGET。它可以直接从 C++ 和 QML 使用。

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property centerᅟ: QGeoCoordinate

此属性保存地理圆的中心坐标。

如果此属性包含无效坐标,则认为圆无效。

默认构造的QGeoCircle使用无效的QGeoCoordinate作为中心。

虽然这个属性是在 Qt 5.5 中引入的,但相关的访问器函数自该类的第一个版本以来就存在。

Access functions:
property radiusᅟ: float

此属性表示圆的半径,单位为米。

如果此属性为负数,则认为圆无效。

默认情况下,半径初始化为 -1

虽然这个属性是在 Qt 5.5 中引入的,但相关的访问器函数自该类的第一个版本以来就存在。

Access functions:
__init__()

构造一个新的无效的地理圆圈。

__init__(other)
Parameters:

其他QGeoCircle

other的内容构造一个新的地理圆。

__init__(other)
Parameters:

其他QGeoShape

other的内容构造一个新的地理圆。

__init__(center[, radius=-1.0])
Parameters:

构造一个以center为中心,半径为radius米的新地理圆。

extendCircle(coordinate)
Parameters:

坐标QGeoCoordinate

扩展地理圆以覆盖坐标 coordinate

radius()
Return type:

浮点数

返回此地理圆的半径,单位为米。

另请参阅

setRadius()

属性 radiusᅟ 的获取器。

setCenter(center)
Parameters:

中心QGeoCoordinate

将此地理圆的中心坐标设置为 center

另请参阅

center()

属性 centerᅟ 的设置器。

setRadius(radius)
Parameters:

radius – 浮点数

设置此地理圆的半径(以米为单位)为 radius

另请参阅

radius()

属性 radiusᅟ 的设置器。

translate(degreesLatitude, degreesLongitude)
Parameters:
  • degreesLatitude – 浮点数

  • degreesLongitude – 浮点数

将这个地理圆向北移动 degreesLatitude 度,向东移动 degreesLongitude 度。

degreesLatitudedegreesLongitude 的负值分别对应于向南和向西的平移。

translated(degreesLatitude, degreesLongitude)
Parameters:
  • degreesLatitude – 浮点数

  • degreesLongitude – 浮点数

Return type:

QGeoCircle

返回此地理圆的一个副本,该副本向北移动了degreesLatitude度,向东移动了degreesLongitude度。

degreesLatitudedegreesLongitude 的负值分别对应于向南和向西的平移。

另请参阅

translate()