QGeoPositionInfo Class
QGeoPositionInfo 클래스에는 특정 시점에 대한 전역 위치, 방향 및 속도에 관한 정보가 포함되어 있습니다. 더 보기...
| 헤더: | #include <QGeoPositionInfo> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning) |
| qmake: | QT += positioning |
- 상속된 멤버를 포함한 모든 멤버 목록
- QGeoPositionInfo는 암시적 공유 클래스의 일부입니다.
공개 유형
| enum | Attribute { Direction, GroundSpeed, VerticalSpeed, MagneticVariation, HorizontalAccuracy, …, DirectionAccuracy } |
공개 함수
| QGeoPositionInfo() | |
| QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime ×tamp) | |
| QGeoPositionInfo(const QGeoPositionInfo &other) | |
(since 6.2) | QGeoPositionInfo(QGeoPositionInfo &&other) |
| ~QGeoPositionInfo() | |
| qreal | attribute(QGeoPositionInfo::Attribute attribute) const |
| QGeoCoordinate | coordinate() const |
| bool | hasAttribute(QGeoPositionInfo::Attribute attribute) const |
| bool | isValid() const |
| void | removeAttribute(QGeoPositionInfo::Attribute attribute) |
| void | setAttribute(QGeoPositionInfo::Attribute attribute, qreal value) |
| void | setCoordinate(const QGeoCoordinate &coordinate) |
| void | setTimestamp(const QDateTime ×tamp) |
(since 6.2) void | swap(QGeoPositionInfo &other) |
| QDateTime | timestamp() const |
(since 6.2) QGeoPositionInfo & | operator=(QGeoPositionInfo &&other) |
| QGeoPositionInfo & | operator=(const QGeoPositionInfo &other) |
관련 비멤버
| bool | operator!=(const QGeoPositionInfo &lhs, const QGeoPositionInfo &rhs) |
| QDataStream & | operator<<(QDataStream &stream, QGeoPositionInfo::Attribute attr) |
| QDataStream & | operator<<(QDataStream &stream, const QGeoPositionInfo &info) |
| bool | operator==(const QGeoPositionInfo &lhs, const QGeoPositionInfo &rhs) |
| QDataStream & | operator>>(QDataStream &stream, QGeoPositionInfo &info) |
| QDataStream & | operator>>(QDataStream &stream, QGeoPositionInfo::Attribute &attr) |
QGeoPositionInfoSource도 참조하십시오 .
멤버 유형 문서
enum QGeoPositionInfo::Attribute
위치 정보에 대한 속성을 정의합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QGeoPositionInfo::Direction | 0 | 진북을 기준으로 시계 방향으로 이동 방향까지의 방위각(도 단위). |
QGeoPositionInfo::GroundSpeed | 1 | 지상 속도(미터/초). |
QGeoPositionInfo::VerticalSpeed | 2 | 수직 속도(미터/초). |
QGeoPositionInfo::MagneticVariation | 3 | 자기장의 수평 성분과 진북 사이의 각도(도 단위). 자기 편각이라고도 합니다. 양수 값은 진북을 기준으로 시계 방향임을, 음수 값은 반시계 방향임을 나타냅니다. |
QGeoPositionInfo::HorizontalAccuracy | 4 | 제공된 위도·경도 값의 정확도(미터 단위). |
QGeoPositionInfo::VerticalAccuracy | 5 | 제공된 고도 값의 정확도(미터 단위). |
QGeoPositionInfo::DirectionAccuracy | 6 | 제공된 방위의 정확도(도 단위). 이 속성은 Android(API 레벨 26 이상) 및 macOS/iOS에서만 사용할 수 있습니다. 자세한 내용은 해당 Android 및 Apple 문서를 참조하십시오. |
NMEA 프로토콜은 또 다른 유형의 정확도인 PositionAccuracy(3차원 정확도 값)도 제안합니다. Qt는 이에 대한 별도의 속성을 제공하지 않습니다. 이 값이 필요한 경우 다음 공식을 바탕으로 계산할 수 있습니다:
PositionAccuracy 2 = HorizontalAccuracy 2 + VerticalAccuracy 2
멤버 함수 문서
QGeoPositionInfo::QGeoPositionInfo()
유효하지 않은 QGeoPositionInfo 객체를 생성합니다.
isValid()도 참조하십시오 .
QGeoPositionInfo::QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime ×tamp)
지정된 coordinate 및 timestamp 에 대한 QGeoPositionInfo를 생성합니다.
QGeoPositionInfo::QGeoPositionInfo(const QGeoPositionInfo &other)
other 의 값을 가진 QGeoPositionInfo 객체를 생성합니다.
[constexpr noexcept default, since 6.2] QGeoPositionInfo::QGeoPositionInfo(QGeoPositionInfo &&other)
other 에서 이동하여 QGeoPositionInfo 객체를 생성합니다.
이동된 QGeoPositionInfo 객체는 소멸시키거나 할당하는 작업만 수행할 수 있습니다. 소멸자나 할당 연산자 외의 다른 함수를 호출할 경우 그 결과는 정의되지 않습니다.
이 함수는 Qt 6.2에서 도입되었습니다.
[noexcept] QGeoPositionInfo::~QGeoPositionInfo()
QGeoPositionInfo 객체를 삭제합니다.
qreal QGeoPositionInfo::attribute(QGeoPositionInfo::Attribute attribute) const
지정된 ` attribute `의 값을 `qreal` 값으로 반환합니다.
값이 설정되지 않은 경우 NaN을 반환합니다.
속성에 값이 설정되었는지 여부를 확인하려면 hasAttribute() 함수를 사용해야 합니다.
hasAttribute() 및 setAttribute()도 참조하십시오 .
QGeoCoordinate QGeoPositionInfo::coordinate() const
이 위치의 좌표를 반환합니다.
좌표가 설정되지 않은 경우 유효하지 않은 좌표를 반환합니다.
setCoordinate()도 참조하십시오 .
bool QGeoPositionInfo::hasAttribute(QGeoPositionInfo::Attribute attribute) const
지정된 ` attribute `가 이 ` QGeoPositionInfo ` 객체에 존재하는 경우 `true`를 반환합니다.
bool QGeoPositionInfo::isValid() const
timestamp()와 coordinate()의 값이 모두 유효한 경우 true를 반환합니다.
QGeoCoordinate::isValid() 및 QDateTime::isValid()도 참조하십시오 .
void QGeoPositionInfo::removeAttribute(QGeoPositionInfo::Attribute attribute)
지정된 attribute 와 해당 값을 제거합니다.
void QGeoPositionInfo::setAttribute(QGeoPositionInfo::Attribute attribute, qreal value)
attribute 의 값을 value 로 설정합니다.
attribute()도 참조하십시오 .
void QGeoPositionInfo::setCoordinate(const QGeoCoordinate &coordinate)
이 위치의 좌표를 coordinate 로 설정합니다.
coordinate()도 참조하십시오 .
void QGeoPositionInfo::setTimestamp(const QDateTime ×tamp)
이 포지션이 timestamp 에 보고된 날짜와 시간을 설정합니다.
timestamp 의 값은 UTC 시간이어야 합니다.
timestamp()도 참조하십시오 .
[noexcept, since 6.2] void QGeoPositionInfo::swap(QGeoPositionInfo &other)
other 와 이 위치 정보를 교환합니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.
이 함수는 Qt 6.2에서 도입되었습니다.
QDateTime QGeoPositionInfo::timestamp() const
이 위치가 보고된 날짜와 시간을 UTC 시간으로 반환합니다.
날짜/시간 값이 설정되지 않은 경우, 유효하지 않은 QDateTime 를 반환합니다.
setTimestamp()도 참조하십시오 .
[noexcept, since 6.2] QGeoPositionInfo &QGeoPositionInfo::operator=(QGeoPositionInfo &&other)
other 의 값을 이 객체로 이동 할당합니다.
이동된 QGeoPositionInfo 는 소멸되거나 할당될 수만 있다는 점에 유의하십시오. 소멸자나 할당 연산자 중 하나를 제외한 다른 함수를 호출할 경우 그 결과는 정의되지 않습니다.
이 함수는 Qt 6.2에서 도입되었습니다.
QGeoPositionInfo &QGeoPositionInfo::operator=(const QGeoPositionInfo &other)
other 의 값을 이 QGeoPositionInfo 에 할당합니다.
관련된 비회원
bool operator!=(const QGeoPositionInfo &lhs, const QGeoPositionInfo &rhs)
lhs 객체의 값 중 하나라도 rhs 의 값과 일치하지 않으면 true 을 반환합니다. 그렇지 않은 경우 false 을 반환합니다.
QDataStream &operator<<(QDataStream &stream, QGeoPositionInfo::Attribute attr)
지정된 ` attr ` 열거형을 ` stream`에 기록합니다.
'Qt 데이터 유형의 직렬화' 항목도 참조하십시오 .
QDataStream &operator<<(QDataStream &stream, const QGeoPositionInfo &info)
지정된 ` info `를 ` stream`에 기록합니다.
'Qt 데이터 유형 직렬화'항목도 참조하십시오 .
bool operator==(const QGeoPositionInfo &lhs, const QGeoPositionInfo &rhs)
lhs 객체의 모든 값이 rhs 의 값과 동일하면 true 을 반환합니다. 그렇지 않으면 false 을 반환합니다.
QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo &info)
지정된 ` stream `에서 좌표를 읽어와 주어진 ` info`에 저장합니다.
'Qt 데이터 유형 직렬화'항목도 참조하십시오 .
QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo::Attribute &attr)
지정된 stream 정보에서 속성 열거형을 읽어와 주어진 attr 에 저장합니다.
'Qt 데이터 유형 직렬화'항목도 참조하십시오 .
© 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.