#include "shell.hpp" #include #include #include #include #include #include "rootwrapper.hpp" void QtShell::reload() { auto* rootobj = QQmlEngine::contextForObject(this)->engine()->parent(); auto* root = qobject_cast(rootobj); if (root == nullptr) { qWarning() << "cannot find RootWrapper for reload, ignoring request"; return; } root->reloadGraph(); } QQmlListProperty QtShell::components() { return QQmlListProperty( this, nullptr, &QtShell::appendComponent, nullptr, nullptr, nullptr, nullptr, nullptr ); } void QtShell::appendComponent(QQmlListProperty* list, QObject* component) { auto* shell = static_cast(list->object); // NOLINT component->setParent(shell); }