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  · 

QMailMessageSetModel Class Reference
[QtMessagingModule]

The QMailMessageSetModel class provides a model for a tree of QMailMessageSets. More...

    #include <QMailMessageSetModel>

This class is under development and is subject to change.

Inherits QAbstractItemModel and QMailMessageSetContainer.

Public Types

  • enum Roles { DisplayNameRole, MessageKeyRole, SubclassUserRole }

Public Functions

Signals

Protected Functions

  • virtual void appended ( QMailMessageSet * item )
  • virtual void removed ( QMailMessageSet * item )
  • virtual void updated ( QMailMessageSet * item )

Additional Inherited Members


Detailed Description

The QMailMessageSetModel class provides a model for a tree of QMailMessageSets.

QMailMessageSetModel provides a model containing sets of messages, arranged in a tree structure. Each node in the tree is a named entity that represents a set of messages, specified by a QMailMessageKey filter. QMailMessageSetModel can be used to construct a hierarchical tree of message folders, or other, more flexible ways of partitioning the set of messages into hierarchical groups.

QMailMessageListModel inherits from QAbstractListModel, so it is suitable for use with the Qt View classes such as QTreeView, to visually represent the hierachical structure.

The model listens for change events emitted from the QMailStore, and automatically propagates these changes to attached views, unless the setIgnoreMailStoreUpdates() function is used to disable this feature.

To customize the display of QMailMessageSets, create a delegate that paints the object as desired, using data elements accessed via the QMailMessageSetModel data() method. The data() function should be overridden to support additional roles, or to customize the display of existing roles.

To define the content of a QMailMessageSetModel, derive classes from QMailMessageSet which select your desired message sets, and add them to the model in the init() member function. The model is informed of the addition, removal and update events for message sets anywhere within the model, via the notification functions appended(), removed() and updated(). Override these functions to perform any content management tasks specific to your model.


Member Type Documentation

enum QMailMessageSetModel::Roles

This enum type is used to define data elements used in common display roles when presenting message set objects.

ConstantValueDescription
QMailMessageSetModel::DisplayNameRoleQt::UserRoleThe name of the message set for display purposes.
QMailMessageSetModel::MessageKeyRole?The message selection key associated with a message set.
QMailMessageSetModel::SubclassUserRole?The first value that should be used by subclasses when defining new message set roles.


Member Function Documentation

QMailMessageSetModel::QMailMessageSetModel ( QObject * parent = 0 )

Constructs a QMailMessageSetModel object with the supplied parent.

By default, mail store updates are not ignored.

See also setIgnoreMailStoreUpdates().

void QMailMessageSetModel::accountContentsModified ( const QMailAccountIdList & ids )   [signal]

Signal that is emitted when changes to messages and folders in the mail store affect the content of the accounts in the list ids.

See also messagesAdded(), messagesUpdated(), messagesRemoved(), foldersAdded(), foldersUpdated(), and foldersRemoved().

QMailAccountId QMailMessageSetModel::accountIdFromIndex ( const QModelIndex & index ) const

Return the identifier of the account associated with the item at index, if that item's type conforms to QMailAccountMessageSet.

void QMailMessageSetModel::accountsAdded ( const QMailAccountIdList & ids )   [signal]

Signal that is emitted when the accounts in the list ids are added to the mail store.

See also accountsRemoved() and accountsUpdated().

void QMailMessageSetModel::accountsRemoved ( const QMailAccountIdList & ids )   [signal]

Signal that is emitted when the accounts in the list ids are removed from the mail store.

See also accountsAdded() and accountsUpdated().

void QMailMessageSetModel::accountsUpdated ( const QMailAccountIdList & ids )   [signal]

Signal that is emitted when the accounts in the list ids are updated within the mail store.

See also accountsAdded() and accountsRemoved().

void QMailMessageSetModel::appended ( QMailMessageSet * item )   [virtual protected]

Updates the model's indexing information when item is appended to a container within the model.

Override this function to perform any management tasks specific to a subclass of QMailMessageSetContainer.

QVariant QMailMessageSetModel::data ( const QModelIndex & index, int role ) const   [virtual]

Returns the data element for the item at index, specified by role.

Note: this function is implemented by invoking the alternative overloaded method.

Reimplemented from QAbstractItemModel.

QVariant QMailMessageSetModel::data ( QMailMessageSet * item, int role, int column ) const   [virtual]

This is an overloaded member function, provided for convenience.

Returns the data element for item, specified by role and column.

void QMailMessageSetModel::folderContentsModified ( const QMailFolderIdList & ids )   [signal]

Signal that is emitted when changes to messages in the mail store affect the content of the folders in the list ids.

See also messagesAdded(), messagesUpdated(), and messagesRemoved().

QMailFolderId QMailMessageSetModel::folderIdFromIndex ( const QModelIndex & index ) const

Return the identifier of the folder associated with the item at index, if that item's type conforms to QMailFolderMessageSet.

void QMailMessageSetModel::foldersAdded ( const QMailFolderIdList & ids )   [signal]

Signal that is emitted when the folders in the list ids are added to the mail store.

See also foldersRemoved() and foldersUpdated().

void QMailMessageSetModel::foldersRemoved ( const QMailFolderIdList & ids )   [signal]

Signal that is emitted when the folders in the list ids are removed from the mail store.

See also foldersAdded() and foldersUpdated().

void QMailMessageSetModel::foldersUpdated ( const QMailFolderIdList & ids )   [signal]

Signal that is emitted when the folders in the list ids are updated within the mail store.

See also foldersAdded() and foldersRemoved().

bool QMailMessageSetModel::ignoreMailStoreUpdates () const

Returns true if the model has been set to ignore updates emitted by the mail store; otherwise returns false.

See also setIgnoreMailStoreUpdates().

QModelIndex QMailMessageSetModel::index ( int row, int column, const QModelIndex & parentIndex ) const   [virtual]

Returns an index object representing the object at row within the container located by parentIndex, having the column column.

Reimplemented from QAbstractItemModel.

QModelIndex QMailMessageSetModel::indexFromAccountId ( const QMailAccountId & id ) const

Return the index of the message set associated with the account identified by id, if one exists.

See also accountIdFromIndex().

QModelIndex QMailMessageSetModel::indexFromFolderId ( const QMailFolderId & id ) const

Return the index of the message set associated with the folder identified by id, if one exists.

See also folderIdFromIndex().

QModelIndex QMailMessageSetModel::indexFromItem ( QMailMessageSet * item ) const

Returns the index within the model of item.

bool QMailMessageSetModel::isEmpty () const

Returns true is the model contains no child message set objects.

QMailMessageSet * QMailMessageSetModel::itemFromIndex ( const QModelIndex & index ) const

Returns the item located at index.

void QMailMessageSetModel::messagesAdded ( const QMailMessageIdList & ids )   [signal]

Signal that is emitted when the messages in the list ids are added to the mail store.

See also messagesRemoved() and messagesUpdated().

void QMailMessageSetModel::messagesRemoved ( const QMailMessageIdList & ids )   [signal]

Signal that is emitted when the messages in the list ids are removed from the mail store.

See also messagesAdded() and messagesUpdated().

void QMailMessageSetModel::messagesUpdated ( const QMailMessageIdList & ids )   [signal]

Signal that is emitted when the messages in the list ids are updated within the mail store.

See also messagesAdded() and messagesRemoved().

QModelIndex QMailMessageSetModel::parent ( const QModelIndex & index ) const   [virtual]

Returns an index object representing the parent container of the message set at index.

Reimplemented from QAbstractItemModel.

void QMailMessageSetModel::removed ( QMailMessageSet * item )   [virtual protected]

Updates the model's indexing information when item is removed from a container within the model.

Override this function to perform any management tasks specific to a subclass of QMailMessageSetContainer.

void QMailMessageSetModel::setIgnoreMailStoreUpdates ( bool ignore )

Sets whether or not mail store updates are ignored to ignore.

If ignoring updates is set to true, the model will ignore updates reported by the mail store. If set to false, the model will automatically synchronize its content in reaction to updates reported by the mail store.

If updates are ignored, signals such as rowInserted and dataChanged will not be emitted; instead, the modelReset signal will be emitted when the model is later changed to stop ignoring mail store updates, and detailed change information will not be accessible.

See also ignoreMailStoreUpdates().

void QMailMessageSetModel::updated ( QMailMessageSet * item )   [virtual protected]

Updates the model's indexing information when item is updated.

Override this function to perform any management tasks specific to a subclass of QMailMessageSetContainer.

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