forked from quickshell/quickshell
feat: attach Qt.quit and Qt.exit functions
This commit is contained in:
parent
e06b07ac01
commit
7467b65809
|
@ -2,6 +2,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include <qcoreapplication.h>
|
||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
#include <qlogging.h>
|
#include <qlogging.h>
|
||||||
|
@ -21,6 +22,10 @@ RootWrapper::RootWrapper(QString rootPath)
|
||||||
, rootPath(std::move(rootPath))
|
, rootPath(std::move(rootPath))
|
||||||
, engine(this)
|
, engine(this)
|
||||||
, originalWorkingDirectory(QDir::current().absolutePath()) {
|
, originalWorkingDirectory(QDir::current().absolutePath()) {
|
||||||
|
auto* app = QCoreApplication::instance();
|
||||||
|
QObject::connect(&this->engine, &QQmlEngine::quit, app, &QCoreApplication::quit);
|
||||||
|
QObject::connect(&this->engine, &QQmlEngine::exit, app, &QCoreApplication::exit);
|
||||||
|
|
||||||
this->reloadGraph(true);
|
this->reloadGraph(true);
|
||||||
|
|
||||||
if (this->root == nullptr) {
|
if (this->root == nullptr) {
|
||||||
|
|
Loading…
Reference in a new issue