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