You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nheko/src/UsersModel.h

30 lines
791 B

#pragma once
#include <QAbstractListModel>
class UsersModel : public QAbstractListModel
{
public:
enum Roles
{
AvatarUrl = Qt::UserRole,
DisplayName,
UserID,
};
UsersModel(const std::string &roomId, QObject *parent = nullptr);
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override
{
(void)parent;
return (int)roomMembers_.size();
}
QVariant data(const QModelIndex &index, int role) const override;
private:
std::string room_id;
std::vector<std::string> roomMembers_;
std::vector<QString> displayNames;
std::vector<QString> userids;
};