forked from quickshell/quickshell
reload: encapsulate each engine generation more
This commit is contained in:
parent
211f454de9
commit
1687ff3614
7 changed files with 125 additions and 79 deletions
23
src/core/generation.hpp
Normal file
23
src/core/generation.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qtclasshelpermacros.h>
|
||||
|
||||
#include "shell.hpp"
|
||||
#include "singleton.hpp"
|
||||
|
||||
class EngineGeneration {
|
||||
public:
|
||||
explicit EngineGeneration();
|
||||
~EngineGeneration();
|
||||
Q_DISABLE_COPY_MOVE(EngineGeneration);
|
||||
|
||||
// assumes root has been initialized, consumes old generation
|
||||
void onReload(EngineGeneration* old);
|
||||
|
||||
static EngineGeneration* findObjectGeneration(QObject* object);
|
||||
|
||||
QQmlEngine engine;
|
||||
ShellRoot* root = nullptr;
|
||||
SingletonRegistry singletonRegistry;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue