ExtendedAttributes QML Type

확장 속성 유형은 Place...에 대한 추가 데이터를 보유합니다.. ..

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

Signals

방법

상세 설명

확장된 속성 유형은 placeAttributes 의 맵입니다. 맵의 속성에 액세스하려면 keys() 메서드를 사용하여 맵에 저장된 키 목록을 가져온 다음 [] 연산자를 사용하여 placeAttribute 항목에 액세스합니다.

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

key설명
openingHours해당 플레이스의 거래 시간
결제비자, 마스터카드 등 스토어에서 사용할 수 있는 결제 유형입니다.
x_provider장소가 공급되는 공급자의 이름입니다.
x_id_<제공자>(예: x_id_here)지정된 공급자의 관점에서 장소를 식별하는 대체 식별자입니다.

일부 플러그인은 속성을 전혀 지원하지 않을 수도 있고, 특정 세트만 지원할 수도 있으며, 시간이 지나면서 동적으로 변경되는 속성 세트를 지원하거나 클라이언트 애플리케이션에서 속성을 임의로 정의할 수 있도록 허용할 수도 있습니다. 예를 들어 한 곳에서는 영업 시간이 있는 반면 다른 곳에서는 영업 시간이 없을 수 있는 등 장소별로 속성이 다를 수도 있습니다. 자세한 내용은 플러그인 참조를 참조하세요.

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

참고: 확장 속성 인스턴스는 Place의 컨텍스트에서만 사용되며, 직접 확장 속성 인스턴스를 만들거나 Place 의 확장 속성 속성을 재할당할 수 없습니다. 익스텐디드 어트리뷰트의 수정은 자바스크립트를 통해서만 가능합니다.

다음 예는 모든 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"

placeAttributeQQmlPropertyMap참조하세요 .

신호 문서

void valueChanged(string key, variant value)

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

해당 핸들러는 onValueChanged 입니다.

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


메서드 문서

variant keys()

현재 지도에 저장된 장소 속성 키의 배열을 반환합니다.


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