quickshell/src/cpp/rootwrapper.hpp

32 lines
576 B
C++
Raw Normal View History

#pragma once
#include <qobject.h>
#include <qobjectdefs.h>
#include <qqmlengine.h>
#include <qtmetamacros.h>
#include <qurl.h>
2024-02-01 09:29:45 +00:00
#include "scavenge.hpp"
#include "shell.hpp"
2024-02-01 09:29:45 +00:00
class RootWrapper: public QObject, virtual public Scavengeable {
Q_OBJECT;
public:
explicit RootWrapper(QUrl rootUrl);
2024-02-01 09:29:45 +00:00
void reloadGraph(bool hard);
void changeRoot(QtShell* newRoot);
2024-02-01 09:29:45 +00:00
QObject* scavengeTargetFor(QObject* child) override;
private slots:
void destroy();
private:
QUrl rootUrl;
QQmlEngine engine;
QtShell* activeRoot = nullptr;
QMetaObject::Connection destroyConnection;
};