Location QML Type
‘위치’ 유형은 위치 데이터를 저장합니다. 더 보기...
| Import Statement: | import QtPositioning |
속성
- address : Address
- boundingShape : geoShape
(since QtPositioning 6.2) - coordinate : coordinate
- extendedAttributes : VariantMap
- location : QGeoLocation
상세 설명
위치 유형은 인간의 관점에서 볼 때 지리적 "위치"를 나타냅니다. 이는 특정 coordinate, address 및 bounding shape 로 구성됩니다. bounding shape 는 이 위치를 볼 때 표시할 권장 지역을 나타냅니다.
위치 유형은 주로 GeocodeModel 와 같은 검색 모델의 콘텐츠로 나타납니다. GeocodeModel 가 주어진 쿼리에 대해 검색된 위치 목록을 반환할 때, 이를 Location 객체로 표현합니다.
사용 예
다음 예제는 간단한 Location 객체를 선언하는 방법을 보여줍니다:
Location {
coordinate {
latitude: -27.3
longitude: 153.1
}
address: Address {
...
}
}속성 설명
address : Address
이 속성은 해당 위치의 주소를 포함하며, 이를 사용하여 해당 위치의 주소 세부 정보를 조회할 수 있습니다.
boundingShape : geoShape [since QtPositioning 6.2]
이 속성은 위치를 표시할 때 사용해야 할 권장 영역을 저장합니다. 예를 들어, 건물의 위치에는 건물을 중심으로 한 영역이 있을 수 있지만, 이 영역은 건물의 바로 주변 지리적 맥락을 보여줄 수 있을 만큼 충분히 넓습니다.
참고: 이 속성은 Qt6에서 boundingBox 속성을 대체하여 도입되었습니다. 이 속성은 geoRectangle 대신 geoShape 를 반환합니다. 도형의 경계 상자(bounding geoRectangle )를 얻으려면 QGeoShape::boundingGeoRectangle()를 사용하십시오.
반환된 도형을 특정 유형으로 변환해야 하는 경우, ` geoShape `의 ` type ` 속성과 ` QtPositioning `의 ` QtPositioning.shapeToRectangle()`과 같은 편의 메서드를 함께 사용하십시오.
이 속성은 QtPositioning 6.2에서 도입되었습니다.
coordinate : coordinate
이 속성은 해당 위치의 정확한 지리적 좌표를 포함하며, 이를 통해 해당 위치의 위도, 경도 및 고도를 조회할 수 있습니다.
extendedAttributes : VariantMap
이 속성에는 해당 위치에 대한 확장 속성이 저장됩니다. 확장 속성은 백엔드에 따라 다르며, 위치에 따라 달라질 수도 있습니다.
location : QGeoLocation
이 속성을 사용하여 C++과 QML 간에 인터페이스를 구축하는 방법에 대한 자세한 내용은“C++과 QML 코드 간의 인터페이스”를 참조하십시오.
참고: 이 속성은 전체 지리적 위치 정보를 업데이트하므로, 이를 사용하면 다른 모든 속성에 대한 바인딩이 모두 끊어집니다.
© 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.