contactDetail QML Value Type
contactDetail 型は、電話番号やウェブサイトのアドレスなどの連絡先詳細を保持します。詳細...
| Import Statement: | import QtLocation 6.12 |
| Since: | QtLocation 5.5 |
プロパティ
詳細説明
contactDetailは、Place への連絡方法に関する単一の詳細情報を提供します。contactDetailは、連絡方法を説明するローカライズされた文字列であるlabel と、実際の連絡先詳細を表すvalue で構成されます。
例
次の例は、JavaScript を使用して場所に 1 つの電話番号を割り当てる方法を示しています。
function writeSingle() {
var phoneNumber = Qt.createQmlObject('import QtLocation; ContactDetail {}', place);
phoneNumber.label = "Phone";
phoneNumber.value = "555-5555"
place.contactDetails.phone = phoneNumber;
}以下は、JavaScriptで場所に複数の電話番号を割り当てる方法を示しています:
function writeMultiple() {
var bob = Qt.createQmlObject('import QtLocation; ContactDetail {}', place);
bob.label = "Bob";
bob.value = "555-5555"
var alice = Qt.createQmlObject('import QtLocation; ContactDetail {}', place);
alice.label = "Alice";
alice.value = "555-8745"
var numbers = new Array();
numbers.push(bob);
numbers.push(alice);
place.contactDetails.phone = numbers;
}なお、QQmlPropertyMap の制限により、QMLで連絡先情報を宣言的に指定することはできず、JavaScriptを介してのみ実現可能です。
プロパティのドキュメント
label : string
このプロパティには、連絡先の詳細を説明するラベルが格納されます。
このラベルは、場合によってはローカライズされる可能性があります。言語は、これを設定するエンティティによって決まりますが、通常はPlugin です。Plugin::locales プロパティは、使用される言語を定義します。
value : string
このプロパティには、電話番号、メールアドレス、ウェブサイトのURLなど、連絡先の詳細情報が格納されます。
© 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.