2021-05-04 18:31:15 +00:00
|
|
|
#ifndef SANDBOXAPP_H
|
|
|
|
#define SANDBOXAPP_H
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
|
2022-08-04 10:54:13 +00:00
|
|
|
#ifdef QT_DEBUG
|
|
|
|
#include <QFileSystemWatcher>
|
|
|
|
#endif
|
|
|
|
|
2021-05-04 18:31:15 +00:00
|
|
|
class SandboxApp : public QGuiApplication
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SandboxApp(int &argc, char **argv);
|
|
|
|
|
|
|
|
void startEngine();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void restartEngine();
|
|
|
|
|
|
|
|
private:
|
2023-05-05 16:05:44 +00:00
|
|
|
std::unique_ptr<QQmlApplicationEngine> m_engine;
|
2022-08-04 10:54:13 +00:00
|
|
|
|
|
|
|
#ifdef QT_DEBUG
|
|
|
|
QFileSystemWatcher m_watcher;
|
2023-10-17 08:09:01 +00:00
|
|
|
void watchDirectoryChanges(const QString& path);
|
2022-08-04 10:54:13 +00:00
|
|
|
#endif
|
2023-04-14 08:18:56 +00:00
|
|
|
|
|
|
|
const QUrl m_url {
|
|
|
|
#ifdef QT_DEBUG
|
|
|
|
QUrl::fromLocalFile(SANDBOX_SRC_DIR + QStringLiteral("/main.qml"))
|
|
|
|
#else
|
|
|
|
QStringLiteral("qrc:/main.qml")
|
|
|
|
#endif
|
|
|
|
};
|
2021-05-04 18:31:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SANDBOXAPP_H
|