#pragma once #include "Cache.h" #include #include class RoomsModel : public QAbstractListModel { public: enum Roles { AvatarUrl = Qt::UserRole, RoomAlias, RoomID, RoomName, }; RoomsModel(QObject *parent = nullptr); QHash roleNames() const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override { (void)parent; return (int)roomAliases.size(); } QVariant data(const QModelIndex &index, int role) const override; private: std::vector rooms_; std::vector roomids; std::vector roomAliases; std::map roomInfos; };