Properly register image pack types

This commit is contained in:
Nicolas Werner 2023-06-19 19:54:58 +02:00
parent b15d889da0
commit 08d5980d40
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 9 additions and 2 deletions

View file

@ -8,10 +8,14 @@
#include <QQmlEngine> #include <QQmlEngine>
#include <QSharedPointer> #include <QSharedPointer>
class SingleImagePackModel; #include "SingleImagePackModel.h"
class ImagePackListModel final : public QAbstractListModel
class ImagePackListModel : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
Q_PROPERTY(bool containsAccountPack READ containsAccountPack CONSTANT) Q_PROPERTY(bool containsAccountPack READ containsAccountPack CONSTANT)
public: public:
enum Roles enum Roles

View file

@ -6,6 +6,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QList> #include <QList>
#include <QQmlEngine>
#include <QUrl> #include <QUrl>
#include <mtx/events/mscs/image_packs.hpp> #include <mtx/events/mscs/image_packs.hpp>
@ -15,6 +16,8 @@
class SingleImagePackModel final : public QAbstractListModel class SingleImagePackModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
Q_PROPERTY(QString roomid READ roomid CONSTANT) Q_PROPERTY(QString roomid READ roomid CONSTANT)
Q_PROPERTY(bool fromSpace READ fromSpace CONSTANT) Q_PROPERTY(bool fromSpace READ fromSpace CONSTANT)