#include "shell.hpp" #include #include #include void QtShell::earlyInit(QObject* old) { auto* oldshell = qobject_cast(old); if (oldshell != nullptr) { this->scavengeableChildren = std::move(oldshell->children); } } QObject* QtShell::scavengeTargetFor(QObject* /* child */) { if (this->scavengeableChildren.length() > this->children.length()) { return this->scavengeableChildren[this->children.length()]; } return nullptr; } 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); shell->children.append(component); }