magpie/root.h

31 lines
602 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-12-16 01:44:25 +00:00
#include <QUrl>
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);
2023-12-16 01:44:25 +00:00
void onAPIAddressChanged(const QUrl& url);
2023-11-24 23:48:01 +00:00
private:
QUrl root;
QQmlApplicationEngine engine;
QQmlContext* context;
API api;
2023-11-22 23:13:33 +00:00
};