QGeoPath Class

QGeoPath 클래스는 지리적 경로를 정의합니다. 더 보기...

Header: #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()가 반환하는 바운딩 박스 계산과 관련이 있으며, 왼쪽 상단 모서리의 위도는 경로 포인트 세트의 최대 위도로 설정됩니다. 마찬가지로 오른쪽 아래 모서리의 위도는 경로 포인트 세트의 최소 위도가 됩니다.

이 클래스는 Q_GADGET. C++ 및 QML에서 직접 사용할 수 있습니다.

좌표를 포함하지 않으면 QGeoPath는 유효하지 않고 비어 있습니다.

참고: 기본으로 구성된 QGeoPath는 좌표를 포함하지 않으므로 유효하지 않고 비어 있습니다.

속성 문서

path : const 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)

좌표 목록(pathwidth)에서 새 지리적 경로를 구축합니다.

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 이 포함된 경우 참을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] QGeoCoordinate QGeoPath::coordinateAt(qsizetype index) const

index 에서 좌표를 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPath::insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)

지정된 indexcoordinate 을 삽입합니다.

참고: 이 함수는 메타객체 시스템과 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 의 경로 요소를 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

지리적 경로 속성을 문자열로 반환합니다.

참고: 이 함수는 메타객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPath::translate(double degreesLatitude, double degreesLongitude)

이 지리적 경로를 degreesLatitude 북쪽으로, degreesLongitude 동쪽으로 번역합니다.

음수 값 degreesLatitudedegreesLongitude 은 각각 남쪽 및 서쪽으로 번역합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] QGeoPath QGeoPath::translated(double degreesLatitude, double degreesLongitude) const

degreesLatitude 북쪽으로, degreesLongitude 동쪽으로 번역된 이 지리적 경로의 복사본을 반환합니다.

음수 값 degreesLatitudedegreesLongitude 은 각각 남쪽 및 서쪽으로의 번역에 해당합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

translate()도 참조하세요 .

qreal QGeoPath::width() const

경로의 너비를 미터 단위로 반환합니다. 이 정보는 contains 메서드에서 사용됩니다. 기본값은 0입니다.

참고: 속성 너비에 대한 게터 함수입니다.

setWidth()도 참조하세요 .

QGeoPath &QGeoPath::operator=(const QGeoPath &other)

other 을 이 지리적 경로에 할당하고 이 지리적 경로에 대한 참조를 반환합니다.

© 2025 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.