magpie/root.h

29 lines
539 B
C
Raw Normal View History

2023-11-22 23:13:33 +00:00
#pragma once
#include <iostream>
2023-11-24 23:48:01 +00:00
#include <stdexcept>
2023-11-22 23:13:33 +00:00
2023-11-24 23:48:01 +00:00
#include <QString>
2023-11-22 23:13:33 +00:00
#include <QGuiApplication>
2023-11-24 23:48:01 +00:00
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "API/api.h"
2023-11-22 23:13:33 +00:00
class Root : public QGuiApplication {
Q_OBJECT
public:
2023-11-24 23:48:01 +00:00
Root(const QUrl& root, int& argc, char* argv[]);
2023-11-22 23:13:33 +00:00
~Root();
bool notify(QObject* receiver, QEvent* e) override;
2023-11-24 23:48:01 +00:00
private slots:
void onObjectCreated(QObject* obj, const QUrl& objUrl);
private:
QUrl root;
QQmlApplicationEngine engine;
QQmlContext* context;
API api;
2023-11-22 23:13:33 +00:00
};