diff --git a/src/cpp/proxywindow.cpp b/src/cpp/proxywindow.cpp index 6e17a55c..0fee2d8b 100644 --- a/src/cpp/proxywindow.cpp +++ b/src/cpp/proxywindow.cpp @@ -10,6 +10,7 @@ #include #include "region.hpp" +#include "reload.hpp" ProxyWindowBase::~ProxyWindowBase() { if (this->window != nullptr) { @@ -28,9 +29,17 @@ void ProxyWindowBase::onReload(QObject* oldInstance) { this->setupWindow(); + for (auto* child: this->pendingChildren) { + Reloadable::reloadRecursive(child, oldInstance); + } + auto backer = this->dataBacker(); for (auto* child: this->pendingChildren) { - backer.append(&backer, child); + // Reparent QQuickItems to the content element, + // while leaving QObjects parented to the proxy window. + if (qobject_cast(child) != nullptr) { + backer.append(&backer, child); + } } this->pendingChildren.clear();