Fix UserSettingsModel and Communities singleton instantiation

This commit is contained in:
Nicolas Werner 2023-06-19 20:30:27 +02:00
parent dd7b627e3d
commit 0278c9d5fb
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
4 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#define INVITEESMODEL_H
#include <QAbstractListModel>
#include <QQmlEngine>
#include <QVector>
#include "timeline/TimelineModel.h"
@ -34,6 +35,8 @@ private:
class InviteesModel final : public QAbstractListModel
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
Q_PROPERTY(TimelineModel *room READ room CONSTANT)

View file

@ -5,6 +5,7 @@
#pragma once
#include <QAbstractListModel>
#include <QQmlEngine>
#include <QSortFilterProxyModel>
#include <mtx/events/power_levels.hpp>
@ -79,6 +80,8 @@ private:
class MemberList final : public QSortFilterProxyModel
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
Q_PROPERTY(QString roomName READ roomName NOTIFY roomNameChanged)
Q_PROPERTY(int memberCount READ memberCount NOTIFY memberCountChanged)

View file

@ -456,6 +456,7 @@ class UserSettingsModel : public QAbstractListModel
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
enum Indices
{

View file

@ -154,7 +154,7 @@ public:
void restoreCollapsed();
};
CommunitiesModel(QObject *parent = nullptr);
CommunitiesModel(QObject *parent);
static CommunitiesModel *create(QQmlEngine *qmlEngine, QJSEngine *)
{