2024-01-25 12:33:02 +00:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-01 02:35:51 +00:00
|
|
|
#include <qcontainerfwd.h>
|
2024-01-25 12:33:02 +00:00
|
|
|
#include <qlogging.h>
|
|
|
|
#include <qobject.h>
|
|
|
|
#include <qqmlengine.h>
|
|
|
|
#include <qqmllist.h>
|
2024-02-01 02:35:51 +00:00
|
|
|
#include <qtmetamacros.h>
|
2024-01-25 12:33:02 +00:00
|
|
|
|
2024-02-01 02:35:51 +00:00
|
|
|
class QtShell: public QObject {
|
2024-01-25 12:33:02 +00:00
|
|
|
Q_OBJECT;
|
2024-02-01 02:35:51 +00:00
|
|
|
Q_PROPERTY(QQmlListProperty<QObject> components READ components FINAL);
|
2024-01-25 12:33:02 +00:00
|
|
|
Q_CLASSINFO("DefaultProperty", "components");
|
|
|
|
QML_ELEMENT;
|
|
|
|
|
|
|
|
public:
|
2024-02-01 02:35:51 +00:00
|
|
|
explicit QtShell(QObject* parent = nullptr): QObject(parent) {}
|
2024-01-25 12:33:02 +00:00
|
|
|
|
2024-02-01 02:35:51 +00:00
|
|
|
QQmlListProperty<QObject> components();
|
2024-01-25 12:33:02 +00:00
|
|
|
|
2024-02-01 01:43:18 +00:00
|
|
|
public slots:
|
|
|
|
void reload();
|
|
|
|
|
2024-01-25 12:33:02 +00:00
|
|
|
private:
|
2024-02-01 02:35:51 +00:00
|
|
|
static void appendComponent(QQmlListProperty<QObject>* list, QObject* component);
|
2024-01-25 12:33:02 +00:00
|
|
|
};
|