Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Address

The Address QML element represents a specific location as a street address. More...

Inherits QtObject

This type was introduced in Qt Location 5.0.

Properties

Detailed Description

An Address is used as a unit of data for queries such as (Reverse) Geocoding or Places searches -- many of these operations either accept an Address or return one.

Not all properties of an Address are necessarily available or relevant in all parts of the world and all locales. The district, state and county properties are particularly area-specific for many data sources (including the provided Nokia plugin), and often only one or two of these is available or useful.

The Address has a text property which holds a formatted string. It is the recommended way to display an address to the user and typically takes the format of an address as found on an envelope, but this is not always the case. The text may be automatically generated from constituent address elements such as street, city and and so on, but can also be explicitly assigned. See text for details.

Example Usage

The following code snippet shows the declaration of an Address element.

 Address {
     id: address
     street: "53 Brandl St"
     city: "Eight Mile Plains"
     country: "Australia"
     countryCode: "AUS"
 }

This could then be used, for example, as the value of a GeocodeModel's query property, to get an exact longitude and latitude for the address.

See also QGeoAddress.

Property Documentation

address : QGeoAddress

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


city : string

This property holds the city of the address as a single formatted string.


country : string

This property holds the country of the address as a single formatted string.


countryCode : string

This property holds the country code of the address as a single formatted string.


county : string

This property holds the county of the address as a single formatted string.


district : string

This property holds the district of the address as a single formatted string.


read-onlyisTextGenerated : bool

This property holds a boolean that if true, indicates that text is automatically generated from address elements. If false, it indicates that the text has been explicitly assigned.


postalCode : string

This property holds the postal code of the address as a single formatted string.


state : string

This property holds the state of the address as a single formatted string.


street : string

This property holds the street of the address but may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.


text : string

This property holds the address as a single formatted string. It is the recommended string to use to display the address to the user. It typically takes the format of an address as found on an envelope, but this is not always necessarily the case.

The adddress text is either automatically generated or explicitly assigned, this can be determined by checking isTextGenerated.

If an empty string is assigned to text, then isTextGenerated will be set to true and text will return a string which is locally formatted according to countryCode and based on the elements of the address. Modifying the address elements such as street, city and so on may cause the contents of text to change.

If a non-empty string is assigned to text, then isTextGenerated will be set to false and text will always return the explicitly assigned string. Modifying address elements will not affect the text property.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web