status-desktop/ui/StatusQ/sandbox/sandboxapp.h

40 lines
693 B
C++

#ifndef SANDBOXAPP_H
#define SANDBOXAPP_H
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#ifdef QT_DEBUG
#include <QFileSystemWatcher>
#endif
class SandboxApp : public QGuiApplication
{
public:
SandboxApp(int &argc, char **argv);
void startEngine();
public slots:
void restartEngine();
private:
std::unique_ptr<QQmlApplicationEngine> m_engine;
#ifdef QT_DEBUG
QFileSystemWatcher m_watcher;
#endif
const QUrl m_url {
#ifdef QT_DEBUG
QUrl::fromLocalFile(SANDBOX_SRC_DIR + QStringLiteral("/main.qml"))
#else
QStringLiteral("qrc:/main.qml")
#endif
};
void watchDirectoryChanges(const QString& path);
};
#endif // SANDBOXAPP_H