From 5e58f0ba9f9b2ac0a1fc4a124835ac36c5a54133 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 16 Feb 2024 23:47:55 -0800 Subject: [PATCH] fix: allow reloadable objects inside of proxy windows --- src/cpp/proxywindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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();