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
30
src/core/incubator.hpp
Normal file
30
src/core/incubator.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <qloggingcategory.h>
|
||||
#include <qobject.h>
|
||||
#include <qqmlincubator.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(logIncubator);
|
||||
|
||||
class QsQmlIncubator
|
||||
: public QObject
|
||||
, public QQmlIncubator {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
explicit QsQmlIncubator(QsQmlIncubator::IncubationMode mode, QObject* parent = nullptr)
|
||||
: QObject(parent)
|
||||
, QQmlIncubator(mode) {}
|
||||
|
||||
void statusChanged(QQmlIncubator::Status status) override;
|
||||
|
||||
signals:
|
||||
void completed();
|
||||
void failed();
|
||||
};
|
||||
|
||||
class DelayedQmlIncubationController: public QQmlIncubationController {
|
||||
// Do nothing.
|
||||
// This ensures lazy loaders don't start blocking before onReload creates windows.
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue