QGeoPath Class
QGeoPath 클래스는 지리적 경로를 정의합니다. 더 보기...
| 헤더: | #include <QGeoPath> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning) |
| qmake: | QT += positioning |
| 상속: | QGeoShape |
속성
공개 함수
| QGeoPath() | |
| QGeoPath(const QGeoShape &other) | |
| QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0) | |
| QGeoPath(const QGeoPath &other) | |
| ~QGeoPath() | |
| void | addCoordinate(const QGeoCoordinate &coordinate) |
| void | clearPath() |
| bool | containsCoordinate(const QGeoCoordinate &coordinate) const |
| QGeoCoordinate | coordinateAt(qsizetype index) const |
| void | insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate) |
| double | length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const |
| const QList<QGeoCoordinate> & | path() const |
| void | removeCoordinate(const QGeoCoordinate &coordinate) |
| void | removeCoordinate(qsizetype index) |
| void | replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate) |
| void | setPath(const QList<QGeoCoordinate> &path) |
| void | setWidth(const qreal &width) |
| qsizetype | size() const |
| QString | toString() const |
| void | translate(double degreesLatitude, double degreesLongitude) |
| QGeoPath | translated(double degreesLatitude, double degreesLongitude) const |
| qreal | width() const |
| QGeoPath & | operator=(const QGeoPath &other) |
상세 설명
경로는 ` QGeoCoordinate ` 객체의 순서 지정된 목록으로 정의됩니다.
경로에서 인접한 두 요소는 두 요소를 모두 통과하는 일정한 방위각의 최단 선분으로 연결되도록 의도되어 있습니다. 이러한 유형의 연결은 경도 방향으로 날짜 변경선을 가로지를 수 있지만, 극점을 가로지르지는 않습니다.
이는 이 도형에 대해 QGeoShape::boundingGeoRectangle()이 반환하는 바운딩 박스의 계산과 관련이 있으며, 이 바운딩 박스의 왼쪽 상단 모서리의 위도는 경로 점 집합의 최대 위도로 설정됩니다. 마찬가지로, 오른쪽 하단 모서리의 위도는 경로 점 집합의 최소 위도가 됩니다.
이 클래스는 QML에서도 geoPath 로 접근할 수 있습니다.
QGeoPath는 좌표가 포함되어 있지 않으면 유효하지 않으면서 동시에 비어 있는 상태가 됩니다.
참고: 기본 생성된QGeoPath는 좌표를 포함하지 않으므로 무효이며 비어 있습니다.
속성 설명서
path : QVariantList
이 속성은 지오 경로의 좌표 목록을 저장합니다.
참고: 좌표는 제자리에서 처리할 수 없습니다. 이 속성의 값을 변경하려면 전체 좌표 목록을 가져온 다음, 이를 처리하고 새로운 값을 속성에 할당해야 합니다.
width : qreal
이 속성은 경로의 너비를 미터 단위로 저장합니다.
액세스 함수:
| qreal | width() const |
| void | setWidth(const qreal &width) |
멤버 함수 설명서
QGeoPath::QGeoPath()
새롭고 빈 지오 경로를 생성합니다.
QGeoPath::QGeoPath(const QGeoShape &other)
other 의 내용을 바탕으로 새로운 지오 경로를 생성합니다.
QGeoPath::QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0)
좌표 목록(path 및 width)을 사용하여 새로운 지오 경로를 생성합니다.
QGeoPath::QGeoPath(const QGeoPath &other)
other 의 내용을 바탕으로 새로운 지오 경로를 생성합니다.
[noexcept] QGeoPath::~QGeoPath()
이 경로를 삭제합니다.
[invokable] void QGeoPath::addCoordinate(const QGeoCoordinate &coordinate)
경로에 coordinate 를 추가합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
void QGeoPath::clearPath()
길을 뚫는다.
[invokable] bool QGeoPath::containsCoordinate(const QGeoCoordinate &coordinate) const
경로에 coordinate 가 요소 중 하나로 포함되어 있으면 true를 반환합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] QGeoCoordinate QGeoPath::coordinateAt(qsizetype index) const
index 에 해당하는 좌표를 반환합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QGeoPath::insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
지정된 index 에 coordinate 를 삽입합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
[invokable] double QGeoPath::length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const
indexFrom 요소에서 indexTo 요소까지의 경로 길이를 미터 단위로 반환합니다. 이 길이는 인접한 점 쌍마다의 최단 거리를 모두 더한 값입니다.
indexTo 가 -1(기본값)인 경우, 길이는 마지막 좌표와 첫 번째 좌표 사이의 거리를 포함하여 계산됩니다(닫힌 루프). 경로의 길이를 가져오려면 indexFrom 에 0을, QGeoPath::size()에 indexTo 의 -1을 사용하십시오.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
const QList<QGeoCoordinate> &QGeoPath::path() const
경로의 모든 요소를 반환합니다.
setPath()도 참조하십시오 .
[invokable] void QGeoPath::removeCoordinate(const QGeoCoordinate &coordinate)
경로에서 ` coordinate `의 마지막 인스턴스를 제거합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
[invokable] void QGeoPath::removeCoordinate(qsizetype index)
경로에서 index 위치에 있는 요소를 제거합니다.
참고: 이 함수는 메타 객체 시스템 및 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QGeoPath::replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
지정된 index 에 있는 path 요소를 coordinate 로 대체합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
void QGeoPath::setPath(const QList<QGeoCoordinate> &path)
path 의 모든 요소를 설정합니다.
path()도 참조하십시오 .
[invokable] qsizetype QGeoPath::size() const
경로에 포함된 요소의 개수를 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] QString QGeoPath::toString() const
geo 경로 속성을 문자열로 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 를 참조하십시오.
[invokable] void QGeoPath::translate(double degreesLatitude, double degreesLongitude)
이 지오 경로를 degreesLatitude 만큼 북쪽으로, degreesLongitude 만큼 동쪽으로 이동시킵니다.
degreesLatitude 와 degreesLongitude 의 음수 값은 각각 남쪽 방향 및 서쪽 방향의 변환에 해당합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
[invokable] QGeoPath QGeoPath::translated(double degreesLatitude, double degreesLongitude) const
degreesLatitude 를 북쪽으로, degreesLongitude 를 동쪽으로 변환한 이 지오 경로의 복사본을 반환합니다.
degreesLatitude 와 degreesLongitude 의 음수 값은 각각 남쪽 및 서쪽 방향으로의 변환을 나타냅니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.
translate()도 참조하십시오 .
qreal QGeoPath::width() const
경로의 너비를 미터 단위로 반환합니다. 이 정보는 ` contains ` 메서드에서 사용됩니다. 기본값은 0입니다.
참고: width 속성에 대한게터 함수입니다.
참조: setWidth().
QGeoPath &QGeoPath::operator=(const QGeoPath &other)
other 를 이 지오 경로에 할당하고, 이 지오 경로에 대한 참조를 반환합니다.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.