#pragma once #include #include #include #include #include #include #include #include "scavenge.hpp" class QtShell: public Scavenger, virtual public Scavengeable { Q_OBJECT; Q_PROPERTY(QQmlListProperty components READ components FINAL); Q_CLASSINFO("DefaultProperty", "components"); QML_ELEMENT; public: explicit QtShell(QObject* parent = nullptr): Scavenger(parent) {} void earlyInit(QObject* old) override; QObject* scavengeTargetFor(QObject* child) override; QQmlListProperty components(); public slots: void reload(bool hard = true); private: static void appendComponent(QQmlListProperty* list, QObject* component); public: // track only the children assigned to `components` in order QList children; QList scavengeableChildren; };