2021-05-04 21:31:15 +03:00
|
|
|
#ifndef SANDBOXAPP_H
|
|
|
|
#define SANDBOXAPP_H
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
|
2022-08-04 13:54:13 +03:00
|
|
|
#ifdef QT_DEBUG
|
|
|
|
#include <QFileSystemWatcher>
|
|
|
|
#endif
|
|
|
|
|
2021-05-04 21:31:15 +03:00
|
|
|
class SandboxApp : public QGuiApplication
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SandboxApp(int &argc, char **argv);
|
|
|
|
|
|
|
|
void startEngine();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void restartEngine();
|
|
|
|
|
|
|
|
private:
|
2023-05-05 19:05:44 +03:00
|
|
|
std::unique_ptr<QQmlApplicationEngine> m_engine;
|
2022-08-04 13:54:13 +03:00
|
|
|
|
|
|
|
#ifdef QT_DEBUG
|
|
|
|
QFileSystemWatcher m_watcher;
|
2023-10-17 11:09:01 +03:00
|
|
|
void watchDirectoryChanges(const QString& path);
|
2022-08-04 13:54:13 +03:00
|
|
|
#endif
|
2023-04-14 11:18:56 +03: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 21:31:15 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SANDBOXAPP_H
|