Add custom roles to the post model and export them to QML
This commit is contained in:
parent
4fbfdf753e
commit
b0185c136b
2 changed files with 50 additions and 0 deletions
|
|
@ -59,6 +59,17 @@ public:
|
|||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
void clear();
|
||||
QHash<int, QByteArray> roleNames() const;
|
||||
|
||||
enum PostRoles {
|
||||
PixmapRole = Qt::UserRole + 1000,
|
||||
FileUrlRole = Qt::UserRole + 1001,
|
||||
ThumbUrlRole = Qt::UserRole + 1002,
|
||||
SizeRole = Qt::UserRole + 1003,
|
||||
RatingRole = Qt::UserRole + 1004,
|
||||
TagRole = Qt::UserRole + 1005,
|
||||
ResolutionRole = Qt::UserRole + 1006
|
||||
};
|
||||
|
||||
private:
|
||||
QVector<DanbooruPost *> m_items;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue