forked from quickshell/quickshell
core/lazyloader: add LazyLoader
Also fixes qml incubation in general, which was completely broken, meaning the native qml Loader type should also work now.
This commit is contained in:
parent
8d742e315e
commit
518977932d
11 changed files with 499 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <qnamespace.h>
|
||||
#include <qobject.h>
|
||||
#include <qqmlcontext.h>
|
||||
#include <qqmlengine.h>
|
||||
#include <qqmllist.h>
|
||||
#include <qquickitem.h>
|
||||
|
@ -11,6 +12,7 @@
|
|||
#include <qtypes.h>
|
||||
#include <qwindow.h>
|
||||
|
||||
#include "generation.hpp"
|
||||
#include "qmlscreen.hpp"
|
||||
#include "region.hpp"
|
||||
#include "reload.hpp"
|
||||
|
@ -33,6 +35,13 @@ ProxyWindowBase::~ProxyWindowBase() {
|
|||
|
||||
void ProxyWindowBase::onReload(QObject* oldInstance) {
|
||||
this->window = this->createWindow(oldInstance);
|
||||
|
||||
if (auto* generation = EngineGeneration::findObjectGeneration(this)) {
|
||||
// All windows have effectively the same incubation controller so it dosen't matter
|
||||
// which window it belongs to. We do want to replace the delay one though.
|
||||
generation->registerIncubationController(this->window->incubationController());
|
||||
}
|
||||
|
||||
this->setupWindow();
|
||||
|
||||
Reloadable::reloadRecursive(this->mContentItem, oldInstance);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue