IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

contactDetail QML Value Type

The contactDetail type holds a contact detail such as a phone number or a website address.

This type was introduced in QtLocation 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

contactDetail QML Value Type

  • Import Statement: import QtLocation 6.5

  • Since:: QtLocation 5.5

  • Group: contactDetail is part of qml-QtLocation5-places, qml-QtLocation5-places-data

I. Detailed Description

The contactDetail provides a single detail on how one could contact a Place. The contactDetail consists of a label, which is a localized string describing the contact method, and a value representing the actual contact detail.

I-1. Examples

The following example demonstrates how to assign a single phone number to a place in JavaScript:

 
Sélectionnez
function writeSingle() {
    var phoneNumber = Qt.createQmlObject('import QtLocation; ContactDetail {}', place);
    phoneNumber.label = "Phone";
    phoneNumber.value = "555-5555"
    place.contactDetails.phone = phoneNumber;
}

The following demonstrates how to assign multiple phone numbers to a place in JavaScript:

 
Sélectionnez
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;
}

Note, due to limitations of the QQmlPropertyMap, it is not possible to declaratively specify the contact details in QML, it can only be accomplished via JavaScript.

II. Property Documentation

 

II-1. label : string

This property holds a label describing the contact detail.

The label can potentially be localized. The language is dependent on the entity that sets it, typically this is the Plugin. The Plugin::locales property defines what language is used.

II-2. value : string

This property holds the value of the contact detail which may be a phone number, an email address, a website url and so on.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+