placeAttribute QML Value Type

장소 속성 유형은 일반적인 장소 속성 정보를 저장합니다. 더 보기...

Import Statement: import QtLocation 6.8
Since: QtLocation 5.5

속성

상세 설명

장소 속성은 Place 유형을 통해 노출되지 않는 Place 에 대한 추가 정보를 저장합니다. 장소 속성은 text 속성과 label 을 통해 액세스할 수 있는 텍스트 데이터입니다. l {placeAttribute::}{text} 및 label 속성은 모두 사용자에게 표시되도록 되어 있습니다. 장소 속성은 고유 키가 있는 ExtendedAttributes 맵에 저장됩니다.

다음 예시는 목록에 모든 속성을 표시하는 방법을 보여줍니다:

import QtQuick
import QtPositioning
import QtLocation

ListView {
    model: place.extendedAttributes.keys()
    delegate: Text {
        text: "<b>" + place.extendedAttributes[modelData].label + ": </b>" +
              place.extendedAttributes[modelData].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"

속성 문서

label : string

이 속성에는 속성을 설명하는 사용자 표시 문자열인 속성 레이블이 있습니다.


text : string

이 속성에는 장소에 대한 추가 정보를 표시하는 데 사용할 수 있는 속성 텍스트가 있습니다.


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