diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-12-31 21:55:47 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-12-31 21:55:47 (GMT) |
commit | 437adabd3798dae0f1eeea0b4f8c2d4212a083e6 (patch) | |
tree | 25cd5d6e449a67d881bb9031416ffee37013201a /Swift/QtUI/UserSearch/UserSearchModel.h | |
parent | 3fdf13823a391c7db83e05685e78db19e4110e59 (diff) | |
download | swift-contrib-437adabd3798dae0f1eeea0b4f8c2d4212a083e6.zip swift-contrib-437adabd3798dae0f1eeea0b4f8c2d4212a083e6.tar.bz2 |
Slightly sensible renderer for user search results.
Resolves: #719
Diffstat (limited to 'Swift/QtUI/UserSearch/UserSearchModel.h')
-rw-r--r-- | Swift/QtUI/UserSearch/UserSearchModel.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/UserSearchModel.h b/Swift/QtUI/UserSearch/UserSearchModel.h index d766d9a..b547033 100644 --- a/Swift/QtUI/UserSearch/UserSearchModel.h +++ b/Swift/QtUI/UserSearch/UserSearchModel.h @@ -17,15 +17,24 @@ namespace Swift { class UserSearchModel : public QAbstractItemModel { Q_OBJECT public: + enum UserItemRoles { + DetailTextRole = Qt::UserRole/*, + AvatarRole = Qt::UserRole + 1, + PresenceIconRole = Qt::UserRole + 2, + StatusShowTypeRole = Qt::UserRole + 3*/ + }; UserSearchModel(); void clear(); void setResults(const std::vector<UserSearchResult>& results); int columnCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + static QVariant data(UserSearchResult* item, int role); QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; QModelIndex parent(const QModelIndex& index) const; int rowCount(const QModelIndex& parent = QModelIndex()) const; private: + static QString nameLine(UserSearchResult* item); + static QString detailLine(UserSearchResult* item); std::vector<UserSearchResult> results_; }; |