Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMailAccountListModel class provides access to a list of stored accounts. More...
#include <QMailAccountListModel>
This class is under development and is subject to change.
Inherits QAbstractListModel.
The QMailAccountListModel class provides access to a list of stored accounts.
The QMailAccountListModel presents a list of all the accounts currently stored in the message store. By using the setKey() and sortKey() functions it is possible to have the model represent specific user filtered subsets of accounts sorted in a particular order.
The QMailAccountListModel is a descendant of QAbstractListModel, so it is suitable for use with the Qt View classes such as QListView to visually represent lists of accounts.
The model listens for changes to the underlying storage system and sychronizes its contents based on the setSynchronizeEnabled() setting.
Accounts can be extracted from the view with the idFromIndex() function and the resultant id can be used to load an account from the store.
For filters or sorting not provided by the QMailAccountListModel it is recommended that QSortFilterProxyModel is used to wrap the model to provide custom sorting and filtering.
See also QMailAccount and QSortFilterProxyModel.
Represents common display roles of an account. These roles are used to display common account elements in a view and its attached delegates.
Constant | Value | Description |
---|---|---|
QMailAccountListModel::NameTextRole | Qt::UserRole | The name of the account |
QMailAccountListModel::MessageTypeRole | ? | The type of the account |
QMailAccountListModel::MessageSourcesRole | ? | The list of message sources for the account |
QMailAccountListModel::MessageSinksRole | ? | The list of message sinks for the account |
Constructs a QMailAccountListModel with a parent parent. By default, the model will match all accounts in the database, and display them in the order they were submitted. Synchronization defaults to true.
Deletes the QMailMessageListModel object.
Returns the QMailAccountId of the account represented by the QModelIndex index. If the index is not valid an invalid QMailAccountId is returned.
Returns the QModelIndex that represents the account with QMailAccountId id. If the id is not conatained in this model, an invalid QModelIndex is returned.
Returns the QMailAccountKey used to populate the contents of this model.
See also setKey().
Sets the QMailAccountKey used to populate the contents of the model to key. If the key is empty, the model is populated with all the accounts from the database.
See also key().
Sets the QMailAccountSortKey used to sort the contents of the model to sortKey. If the sort key is invalid, no sorting is applied to the model contents and accounts are displayed in the order in which they were added into the database.
See also sortKey().
Sets wheather the model synchronizes its contents based on account changes in the database to val.
See also synchronizeEnabled().
Returns the QMailAccountSortKey used to sort the contents of the model.
See also setSortKey().
Returns true if the model sychronizes its contents based on account changes in the database, otherwise returns false.
See also setSynchronizeEnabled().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |