이 페이지에서

placeAttribute QML Value Type

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

Import Statement: import QtLocation 6.12
Since: QtLocation 5.5

속성

상세 설명

place 속성은 Place 유형을 통해 별도로 노출되지 않는 Place 에 대한 추가 정보를 저장합니다. placeAttribute는 텍스트 형태의 데이터로, text 속성을 통해 접근할 수 있으며, label 입니다. l {placeAttribute::}{text} 및 label 속성은 모두 사용자에게 표시되도록 설계되었습니다. placeAttribute는 고유한 키를 가진 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

이 속성에는 속성을 설명하는, 사용자에게 표시되는 문자열인 'label' 속성이 포함되어 있습니다.

text : string

이 속성에는 해당 장소에 대한 추가 정보를 표시하는 데 사용할 수 있는 ‘text’ 속성이 포함되어 있습니다.

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