이 페이지에서

ExtendedAttributes QML Type

ExtendedAttributes 유형은 확장 속성( Place)에 대한 추가 데이터를 포함합니다. 더 보기...

Import Statement: import QtLocation 6.12
Since: QtLocation 5.5
In C++: QQmlPropertyMap

신호

방법

상세 설명

ExtendedAttributes 유형은 placeAttributes 의 맵입니다. 맵 내의 속성에 접근하려면 keys() 메서드를 사용하여 맵에 저장된 키 목록을 가져온 다음, [] 연산자를 사용하여 placeAttribute 항목에 접근하십시오.

다음은 API에서 정의한 표준 키들입니다. Plugin 구현체는 추가 키를 자유롭게 정의할 수 있습니다. 사용자 정의 키는 충돌을 방지하기 위해 고유한 접두사를 붙여야 합니다.

key설명
openingHours장소의 영업 시간
payment해당 장소에서 허용하는 결제 수단(예: Visa, Mastercard).
x_provider해당 장소의 공급업체 이름
x_id_<provider> (예: x_id_here)지정된 제공업체의 관점에서 해당 장소를 식별하는 대체 식별자입니다.

일부 플러그인은 속성을 전혀 지원하지 않을 수도 있고, 다른 플러그인은 특정 세트만 지원하거나, 시간이 지남에 따라 동적으로 변화하는 속성 세트를 지원하거나, 심지어 클라이언트 애플리케이션에서 속성을 임의로 정의할 수 있도록 허용할 수도 있습니다. 속성은 장소마다 다를 수도 있습니다. 예를 들어, 한 장소에는 영업 시간이 있지만 다른 장소에는 없을 수 있습니다. 자세한 내용은 플러그인 참조 문서를 확인하십시오.

일부 속성은 최종 사용자가 읽을 수 있도록 의도되지 않았을 수 있으며, 이러한 속성의 레이블 필드는 이를 나타내기 위해 비어 있습니다.

참고: ExtendedAttributes 인스턴스는 항상 Place의 컨텍스트 내에서만 사용됩니다. ExtendedAttributes 인스턴스를 직접 생성하거나 Place 의 ExtendedAttributes 속성을 재할당하는 것은 불가능합니다. ExtendedAttributes의 수정은 자바스크립트를 통해서만 수행할 수 있습니다.

다음 예제는 모든 placeAttributes 에 액세스하여 콘솔에 출력하는 방법을 보여줍니다:

import QtPositioning
import QtLocation

function printExtendedAttributes(extendedAttributes) {
    var keys = extendedAttributes.keys();
    for (var i = 0; i < keys.length; ++i) {
        var key = keys[i];
        if (extendedAttributes[key].label !== "")
            console.log(extendedAttributes[key].label + ": " + extendedAttributes[key].text);
    }
}

다음 예제는 속성을 할당하고 수정하는 방법을 보여줍니다:

    //assign a new attribute to a place
    var smokingAttrib = Qt.createQmlObject('import QtLocation; PlaceAttribute {}', place);
    smokingAttrib.label = "Smoking Allowed"
    smokingAttrib.text = "No"
    place.extendedAttributes.smoking = smokingAttrib;

    //modify an existing attribute
    place.extendedAttributes.smoking.text = "Yes"

placeAttribute 및 QQmlPropertyMap항목도 참조하십시오 .

Signal 문서

void valueChanged(string key, variant value)

이 신호는 속성 집합이 변경될 때 발생합니다. ` key `는 변경된 ` value `에 해당하는 키입니다.

해당 핸들러는 onValueChanged 입니다.

참고: 해당 핸들러는 onValueChanged 입니다.

메서드 문서

variant keys()

현재 맵에 저장된 위치 속성 키들의 배열을 반환합니다.

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