placeAttribute QML Value Type
placeAttribute型は、一般的な場所の属性情報を保持します。詳細...
Import Statement: | import QtLocation 6.8 |
Since: | QtLocation 5.5 |
プロパティ
詳細な説明
場所属性は、Place の型を通して公開されていない、Place に関する追加情報を格納する。placeAttributeは、text プロパティを通してアクセス可能なテキスト・データであり、label 。 l {placeAttribute::}{text}とlabel プロパティは、どちらもユーザーに表示されることを意図しています。placeAttributesは、一意なキーを持つ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"
プロパティ Documentation
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.