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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QMailAddress Class Reference
[QtMessagingModule, QtPimModule]

The QMailAddress class provides an interface for manipulating message address strings. More...

    #include <QMailAddress>

Public Functions

Static Public Members


Detailed Description

The QMailAddress class provides an interface for manipulating message address strings.

QMailAddress provides functions for splitting the address strings of messages into name and address components, and for combining the individual components into correctly formatted address strings. QMailAddress can be used to manipulate the address elements exposed by the QMailMessage class.

Address strings are expected to use the format "name_part '<'address_part'>'", where name_part describes a message sender or recipient and address_part defines the address at which they can be contacted. The address component is not validated, so it can contain an email address, phone number, or any other type of textual address representation.

See also QMailMessage.


Member Function Documentation

QMailAddress::QMailAddress ()

Constructs an empty QMailAddress object.

QMailAddress::QMailAddress ( const QString & addressText )

Constructs a QMailAddress object, extracting the name and address components from addressText.

If addressText cannot be separated into name and address components, both name() and address() will return the entirety of addressText.

See also name() and address().

QMailAddress::QMailAddress ( const QString & name, const QString & address )

Constructs a QMailAddress object with the given name and address.

QMailAddress::~QMailAddress ()

Destroys a QMailAddress object.

QString QMailAddress::address () const

Returns the address component of a mail address string.

QString QMailAddress::displayName () const

Returns a name to represent the address. If the address matches that of a stored Contact then the display name will be the contact's label. If no matching Contact is found, the name component of the address will be returned.

See also matchContact().

QString QMailAddress::displayName ( QContactModel & fromModel ) const

This is an overloaded member function, provided for convenience.

Returns a name to represent the address by querying the existing QContactModel fromModel. If the address matches that of a stored Contact then the display name will be the contact's label. If no matching Contact is found, the name component of the address will be returned.

See also matchContact().

QList<QMailAddress> QMailAddress::fromStringList ( const QString & list )   [static]

Returns a list containing a QMailAddress object constructed from each comma-separated address in list.

QList<QMailAddress> QMailAddress::fromStringList ( const QStringList & list )   [static]

This is an overloaded member function, provided for convenience.

Returns a list containing a QMailAddress object constructed from each address string in list.

QList<QMailAddress> QMailAddress::groupMembers () const

Returns a list containing the individual addresses that comprise the address group. If the address is not a group address, an empty list is returned.

See also isGroup().

bool QMailAddress::isChatAddress () const

Returns true if the address component has the form of an instant message address; otherwise returns false.

See also isEmailAddress(), isPhoneNumber(), and matchContact().

bool QMailAddress::isEmailAddress () const

Returns true if the address component has the form of an email address; otherwise returns false.

See also isPhoneNumber(), isChatAddress(), and matchContact().

bool QMailAddress::isGroup () const

Returns true if the address is that of a group.

bool QMailAddress::isNull () const

Returns true if the address object has not been initialized.

bool QMailAddress::isPhoneNumber () const

Returns true if the address component has the form of a phone number; otherwise returns false.

See also isEmailAddress(), isChatAddress(), and matchContact().

QContact QMailAddress::matchContact () const

Find the stored Contact whose email address or phone number matches the address component of the address text. If no matching contact is found, an empty Contact is returned.

See also displayName(), matchesExistingContact(), QContactModel::matchPhoneNumber(), and QContactModel::matchEmailAddress().

QContact QMailAddress::matchContact ( QContactModel & fromModel ) const

This is an overloaded member function, provided for convenience.

Find the stored Contact whose email address or phone number matches the address component of the address text within the existing QContactModel fromModel. If no matching contact is found, a null Contact is returned.

See also displayName(), QContactModel::matchPhoneNumber(), and QContactModel::matchEmailAddress().

bool QMailAddress::matchesExistingContact () const

Returns true if there exists a stored Contact whose email address or phone number matches the address component of the address text; otherwise returns false.

See also matchContact().

QString QMailAddress::name () const

Returns the name component of a mail address string.

QString QMailAddress::removeComments ( const QString & input )   [static]

Returns the content of input with any comment sections removed. Any subsequent leading or trailing whitespace is then also removed.

QString QMailAddress::removeWhitespace ( const QString & input )   [static]

Returns the content of input with any whitespace characters removed. Whitespace within quotes or comment sections is preserved.

QString QMailAddress::toString () const

Returns a string containing the name and address in a standardised format.

QStringList QMailAddress::toStringList ( const QList<QMailAddress> & list )   [static]

Returns a string list containing the result of calling toString() on each address in list.

See also toString().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment créer une fenêtre À propos

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 qtextended4.4
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