Sorry this is a huge commit, this actually includes a ton of stuff. Text color is now readable, multiple accounts are supported alongside end-to-end encryption but no cross-signing yet :-) There's also a whole lot of other small changes, such as choosing the server you want to request a room directory from.
41 lines
770 B
C++
Executable file
41 lines
770 B
C++
Executable file
#pragma once
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
class Room;
|
|
|
|
class MemberModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
enum EventRoles {
|
|
DisplayNameRole = Qt::UserRole + 1,
|
|
AvatarURLRole,
|
|
IdRole,
|
|
SectionRole
|
|
};
|
|
|
|
int rowCount(const QModelIndex &parent) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
void beginUpdate(const unsigned int num) {
|
|
beginInsertRows(QModelIndex(), 0, num);
|
|
}
|
|
|
|
void endUpdate() {
|
|
endInsertRows();
|
|
}
|
|
|
|
void setRoom(Room* room) {
|
|
this->room = room;
|
|
}
|
|
|
|
void fullUpdate() {
|
|
emit layoutChanged();
|
|
}
|
|
|
|
protected:
|
|
Room* room = nullptr;
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
};
|