ContactDetail QML Type | Qt Location 5.15.18

- Qt 5.15
- Qt Location
- QML Types
- ContactDetail QML Type
- Qt 5.15.18 Reference Documentation

# ContactDetail QML Type

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

Import Statement: | import QtLocation 5.15
Since: | QtLocation 5.5

- List of all members, including inherited members

## Properties

- contactDetail : QPlaceContactDetail
- label : string
- value : string

## 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.

## Examples

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

     function writeSingle() {
         var phoneNumber = Qt.createQmlObject('import QtLocation 5.3; 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:

     function writeMultiple() {
         var bob = Qt.createQmlObject('import QtLocation 5.3; ContactDetail {}', place);
         bob.label = "Bob";
         bob.value = "555-5555"

         var alice = Qt.createQmlObject('import QtLocation 5.3; 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.

## Property Documentation

contactDetail : QPlaceContactDetail

For details on how to use this property to interface between C++ and QML see "Interfaces between C++ and QML Code".

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.

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.