이 페이지에서

QGeoAddress Class

QGeoAddress 클래스는 지리적 위치( QGeoLocation)의 주소를 나타냅니다. 더 보기...

헤더: #include <QGeoAddress>
CMake: find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
qmake: QT += positioning

공개 함수

QGeoAddress()
QGeoAddress(const QGeoAddress &other)
(since 6.2) QGeoAddress(QGeoAddress &&other)
~QGeoAddress()
QString city() const
void clear()
QString country() const
QString countryCode() const
QString county() const
QString district() const
bool isEmpty() const
bool isTextGenerated() const
QString postalCode() const
void setCity(const QString &city)
void setCountry(const QString &country)
void setCountryCode(const QString &countryCode)
void setCounty(const QString &county)
void setDistrict(const QString &district)
void setPostalCode(const QString &postalCode)
void setState(const QString &state)
void setStreet(const QString &street)
(since 6.2) void setStreetNumber(const QString &streetNumber)
void setText(const QString &text)
QString state() const
QString street() const
(since 6.2) QString streetNumber() const
(since 6.2) void swap(QGeoAddress &other)
QString text() const
(since 6.2) QGeoAddress &operator=(QGeoAddress &other)
QGeoAddress &operator=(const QGeoAddress &address)
size_t qHash(const QGeoAddress &address, size_t seed = 0)
bool operator!=(const QGeoAddress &lhs, const QGeoAddress &rhs)
bool operator==(const QGeoAddress &lhs, const QGeoAddress &rhs)

상세 설명

주소의 속성은 미국 지형명 표준으로 정규화되어 있으며, 현지 지형명 수준에 매핑될 수 있습니다(예: State는 독일의 "Bundesland"에 해당).

이 주소에는 표시 용도로 사용되는 text()이 포함되어 있으며, 주소의 구성 요소에 접근할 수 있는 추가 속성이 있습니다:

멤버 함수 설명서

QGeoAddress::QGeoAddress()

기본 생성자.

QGeoAddress::QGeoAddress(const QGeoAddress &other)

other 의 복사본을 생성합니다.

[constexpr noexcept default, since 6.2] QGeoAddress::QGeoAddress(QGeoAddress &&other)

other 에서 데이터를 가져와 지리적 주소 객체를 생성합니다.

참고: 이동된 QGeoAddress객체는 소멸시키거나 할당하는 용도로만 사용할 수 있습니다. 소멸자나 할당 연산자 중 하나를 제외한 다른 함수를 호출할 경우 그 결과는 정의되지 않습니다.

이 함수는 Qt 6.2에서 도입되었습니다.

[noexcept] QGeoAddress::~QGeoAddress()

이 주소를 삭제합니다.

QString QGeoAddress::city() const

도시 이름을 반환합니다.

setCity()도 참조하십시오 .

void QGeoAddress::clear()

해당 주소의 모든 데이터 필드를 지웁니다.

QString QGeoAddress::country() const

국가 이름을 반환합니다.

setCountry()도 참조하십시오 .

QString QGeoAddress::countryCode() const

ISO 3166-1 알파-3에 따른 국가 코드를 반환합니다.

setCountryCode()도 참조하십시오 .

QString QGeoAddress::county() const

카운티를 반환합니다. 카운티는 국가 바로 아래에 위치한 두 번째 행정 구역으로 간주됩니다.

setCounty()도 참조하십시오 .

QString QGeoAddress::district() const

행정구를 반환합니다. 행정구는 시 아래의 하위 행정 구역으로 간주됩니다.

setDistrict()도 참조하십시오 .

bool QGeoAddress::isEmpty() const

이 주소가 비어 있는지 여부를 반환합니다. 주소의 모든 필드가 비어 있으면 해당 주소는 비어 있는 것으로 간주됩니다.

bool QGeoAddress::isTextGenerated() const

QGeoAddress::text()가 주소 요소로부터 자동 생성된 경우 true를 반환하고, text()가 명시적으로 할당된 경우에는 false를 반환합니다.

text() 및 setText()도 참조하십시오 .

QString QGeoAddress::postalCode() const

우편번호를 반환합니다.

setPostalCode()도 참조하십시오 .

void QGeoAddress::setCity(const QString &city)

city 를 설정합니다.

city()도 참조하십시오 .

void QGeoAddress::setCountry(const QString &country)

country 의 이름을 설정합니다.

country()도 참조하십시오 .

void QGeoAddress::setCountryCode(const QString &countryCode)

ISO 3166-1 알파-3에 따라 ‘ countryCode ’를 설정합니다.

countryCode()도 참조하십시오 .

void QGeoAddress::setCounty(const QString &county)

county 를 설정합니다.

county()도 참조하십시오 .

void QGeoAddress::setDistrict(const QString &district)

district 를 설정합니다.

district()도 참조하십시오 .

void QGeoAddress::setPostalCode(const QString &postalCode)

postalCode 를 설정합니다.

postalCode()도 참조하십시오 .

void QGeoAddress::setState(const QString &state)

state 를 설정합니다.

state()도 참조하십시오 .

void QGeoAddress::setStreet(const QString &street)

거리 이름을 street 로 설정합니다.

참고: Qt6이전 버전에서는 이 값에 호수, 건물명 또는 주소를 서로 구별하는 데 사용될 수 있는 기타 정보가 포함될 수도 있었습니다. 현재는 setStreetNumber()을 사용하여 이 데이터를 설정하십시오.

street() 및 setStreetNumber()도 참조하십시오 .

[since 6.2] void QGeoAddress::setStreetNumber(const QString &streetNumber)

건물 번호를 ‘ streetNumber ’로 설정합니다.

여기에는 호수, 건물명 또는 주소를 서로 구별하는 데 사용될 수 있는 기타 정보가 포함될 수도 있습니다.

참고: Qt6이전에는 이 정보가 setStreet() 메서드로 설정되었습니다.

이 함수는 Qt 6.2에서 도입되었습니다.

streetNumber() 및 setStreet()도 참조하십시오 .

void QGeoAddress::setText(const QString &text)

text 가 비어 있지 않은 경우, text()가 반환할 문자열로 text 을 명시적으로 할당합니다. isTextGenerated()는 false를 반환합니다.

text 가 비어 있는 경우, text()가 주소 요소들로부터 자동으로 생성되어야 함을 나타냅니다. isTextGenerated()는 true를 반환합니다.

text()도 참조하십시오 .

QString QGeoAddress::state() const

상태를 반환합니다. 상태는 국가 아래의 첫 번째 하위 행정구역으로 간주됩니다.

setState()도 참조하십시오 .

QString QGeoAddress::street() const

거리 이름을 반환합니다.

참고: Qt6이전 버전에서는 이 값에 호수, 건물명 또는 주소를 서로 구별하는 데 사용될 수 있는 기타 정보가 포함될 수도 있었습니다. 현재는 streetNumber()를 사용하여 이 데이터를 가져오십시오.

setStreet() 및 streetNumber()도 참조하십시오 .

[since 6.2] QString QGeoAddress::streetNumber() const

건물 번호를 반환합니다.

여기에는 호수, 건물명 또는 주소를 서로 구별하는 데 사용될 수 있는 기타 정보가 포함될 수도 있습니다.

참고: Qt 6이전에는 이 정보가 ` street()` 메서드를 통해 반환되었습니다.

이 함수는 Qt 6.2에서 도입되었습니다.

setStreetNumber() 및 street()도 참조하십시오 .

[noexcept, since 6.2] void QGeoAddress::swap(QGeoAddress &other)

이 주소를 other 로 바꿉니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.

이 함수는 Qt 6.2에서 도입되었습니다.

QString QGeoAddress::text() const

주소를 단일 서식 지정된 문자열로 반환합니다. 이 문자열은 사용자에게 주소를 표시할 때 사용하는 것이 권장됩니다. 일반적으로 봉투에 기재된 주소 형식을 따르지만, 항상 그런 것은 아닙니다.

주소 텍스트는 자동으로 생성되거나 명시적으로 할당됩니다. 이는 ` isTextGenerated`을 확인하여 알 수 있습니다.

setText()에 빈 문자열이 전달되면, isTextGenerated()는 true 로 설정되며, text()는 countryCode()에 따라 로컬에서 서식이 지정되고, 거리, 도시 등과 같은 주소 요소를 기반으로 한 문자열을 반환합니다. 텍스트 문자열은 주소 요소들을 기반으로 생성되므로, text(), setStreet(), text()와 같은 호출 순서를 따를 경우 text()가 호출될 때마다 서로 다른 문자열이 반환될 수 있습니다.

setText()에 비어 있지 않은 문자열이 제공되면, isTextGenerated()는 false 로 설정되며, text()는 항상 명시적으로 할당된 문자열을 반환합니다. setStreet(), setCity() 등과 같은 다른 요소를 수정하는 호출은 text()에서 반환되는 문자열에 영향을 미치지 않습니다.

setText()도 참조하십시오 .

[implicit, since 6.2] QGeoAddress &QGeoAddress::operator=(QGeoAddress &other)

other 를 이 주소로 이동 할당하고, 이 주소에 대한 참조를 반환합니다.

참고: 이동된 QGeoAddress 객체는 소멸되거나 할당될 수만 있습니다. 소멸자나 할당 연산자 중 하나를 제외한 다른 함수를 호출할 경우의 결과는 정의되지 않습니다.

이 함수는 Qt 6.2에서 도입되었습니다.

QGeoAddress &QGeoAddress::operator=(const QGeoAddress &address)

지정된 ` address `를 이 주소에 할당하고, 이 주소에 대한 참조를 반환합니다.

관련 비회원

[noexcept] size_t qHash(const QGeoAddress &address, size_t seed = 0)

seed 를 사용하여 address 의 해시 값을 반환합니다.

bool operator!=(const QGeoAddress &lhs, const QGeoAddress &rhs)

lhs 주소가 rhs 과 일치하지 않으면 true 를 반환하고, 일치하는 경우 false 를 반환합니다.

bool operator==(const QGeoAddress &lhs, const QGeoAddress &rhs)

lhs 주소가 rhs 와 일치하면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

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