Created
July 21, 2011 13:53
-
-
Save kovrov/1097233 to your computer and use it in GitHub Desktop.
QMF query threads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QMailStore *store = QMailStore::instance(); | |
QMailAccountIdList accounts = store->queryAccounts(); | |
QMailAccount account = QMailAccount(accounts[0]); | |
QMailFolderId folder_id = account.standardFolder(QMailFolder::InboxFolder); | |
QMailMessageKey folder_key = QMailMessageKey::parentFolderId(folder_id); | |
QMailThreadKey select_key = QMailThreadKey::includes(folder_key); | |
// we can only sort by id or serverUid ? | |
QMailThreadSortKey sort_key = QMailThreadSortKey::id(Qt::AscendingOrder); | |
QMailThreadIdList list = store->queryThreads(select_key, sort_key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QMailThreadModel : public QAbstractItemModel | |
{ | |
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; | |
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; | |
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; | |
virtual QModelIndex parent(const QModelIndex &index) const; | |
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; | |
void setKey(const QMailThreadKey &key); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment