contactDetail QML Value Type
Il tipo `contactDetail` contiene i dettagli di un contatto, come un numero di telefono o l'indirizzo di un sito web. Per saperne di più...
| Import Statement: | import QtLocation 6.12 |
| Since: | QtLocation 5.5 |
Proprietà
Descrizione dettagliata
Il contactDetail fornisce un singolo dettaglio su come contattare un Place. Il contactDetail è costituito da un label, ovvero una stringa localizzata che descrive il metodo di contatto, e da un value che rappresenta i dettagli effettivi di contatto.
Esempi
L'esempio seguente mostra come assegnare un singolo numero di telefono a un luogo in JavaScript:
function writeSingle() {
var phoneNumber = Qt.createQmlObject('import QtLocation; ContactDetail {}', place);
phoneNumber.label = "Phone";
phoneNumber.value = "555-5555"
place.contactDetails.phone = phoneNumber;
}Quanto segue illustra come assegnare più numeri di telefono a un luogo in 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;
}Nota: a causa delle limitazioni dell’ QQmlPropertyMap, non è possibile specificare in modo dichiarativo i dettagli di contatto in QML; ciò può essere fatto solo tramite JavaScript.
Documentazione delle proprietà
label : string
Questo campo contiene un'etichetta che descrive i dettagli di contatto.
L'etichetta può essere localizzata. La lingua dipende dall'entità che la imposta, in genere l'Plugin. La proprietà Plugin::locales definisce quale lingua viene utilizzata.
value : string
Questa proprietà contiene il valore dei dettagli di contatto, che può essere un numero di telefono, un indirizzo e-mail, l'URL di un sito web e così via.
© 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.