magpie/root.h

31 lines
602 B
C++

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