Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
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.
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.
This enum type is used to define data elements used in common display roles when presenting message set objects.
Constant | Value | Description |
---|---|---|
QMailMessageSetModel::DisplayNameRole | Qt::UserRole | The 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. |
Constructs a QMailMessageSetModel object with the supplied parent.
By default, mail store updates are not ignored.
See also setIgnoreMailStoreUpdates().
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().
Return the identifier of the account associated with the item at index, if that item's type conforms to QMailAccountMessageSet.
Signal that is emitted when the accounts in the list ids are added to the mail store.
See also accountsRemoved() and accountsUpdated().
Signal that is emitted when the accounts in the list ids are removed from the mail store.
See also accountsAdded() and accountsUpdated().
Signal that is emitted when the accounts in the list ids are updated within the mail store.
See also accountsAdded() and accountsRemoved().
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.
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.
This is an overloaded member function, provided for convenience.
Returns the data element for item, specified by role and column.
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().
Return the identifier of the folder associated with the item at index, if that item's type conforms to QMailFolderMessageSet.
Signal that is emitted when the folders in the list ids are added to the mail store.
See also foldersRemoved() and foldersUpdated().
Signal that is emitted when the folders in the list ids are removed from the mail store.
See also foldersAdded() and foldersUpdated().
Signal that is emitted when the folders in the list ids are updated within the mail store.
See also foldersAdded() and foldersRemoved().
Returns true if the model has been set to ignore updates emitted by the mail store; otherwise returns false.
See also setIgnoreMailStoreUpdates().
Returns an index object representing the object at row within the container located by parentIndex, having the column column.
Reimplemented from QAbstractItemModel.
Return the index of the message set associated with the account identified by id, if one exists.
See also accountIdFromIndex().
Return the index of the message set associated with the folder identified by id, if one exists.
See also folderIdFromIndex().
Returns the index within the model of item.
Returns true is the model contains no child message set objects.
Returns the item located at index.
Signal that is emitted when the messages in the list ids are added to the mail store.
See also messagesRemoved() and messagesUpdated().
Signal that is emitted when the messages in the list ids are removed from the mail store.
See also messagesAdded() and messagesUpdated().
Signal that is emitted when the messages in the list ids are updated within the mail store.
See also messagesAdded() and messagesRemoved().
Returns an index object representing the parent container of the message set at index.
Reimplemented from QAbstractItemModel.
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.
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().
Updates the model's indexing information when item is updated.
Override this function to perform any management tasks specific to a subclass of QMailMessageSetContainer.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |