このページでは

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.