Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
trinity/include/emotelistmodel.h

27 lines
505 B
C
Raw Normal View History

2021-07-21 16:08:15 -04:00
#pragma once
#include <QAbstractListModel>
#include <QDebug>
#include "emote.h"
2022-08-15 21:53:56 -04:00
class EmoteListModel : public QAbstractListModel {
2021-07-21 16:08:15 -04:00
Q_OBJECT
public:
2022-08-15 21:53:56 -04:00
int rowCount(const QModelIndex& parent) const override;
2021-07-21 16:08:15 -04:00
2022-08-15 21:53:56 -04:00
QVariant data(const QModelIndex& index, int role) const override;
2021-07-21 16:08:15 -04:00
void setList(QList<Emote*>* emotes) {
this->emotes = emotes;
emit layoutChanged();
}
void update() {
emit layoutChanged();
}
protected:
QList<Emote*>* emotes = nullptr;
};