forked from quickshell/quickshell
feat: add hard reload signal and wrap root object
This commit is contained in:
parent
d14258df8e
commit
9a5ad44aa9
6 changed files with 116 additions and 22 deletions
28
src/cpp/rootwrapper.hpp
Normal file
28
src/cpp/rootwrapper.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qobjectdefs.h>
|
||||
#include <qqmlengine.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qurl.h>
|
||||
|
||||
#include "shell.hpp"
|
||||
|
||||
class RootWrapper: public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
explicit RootWrapper(QUrl rootUrl);
|
||||
|
||||
void reloadGraph();
|
||||
void changeRoot(QtShell* newRoot);
|
||||
|
||||
private slots:
|
||||
void destroy();
|
||||
|
||||
private:
|
||||
QUrl rootUrl;
|
||||
QQmlEngine engine;
|
||||
QtShell* activeRoot = nullptr;
|
||||
QMetaObject::Connection destroyConnection;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue