32 lines
732 B
C++
Raw Normal View History

2018-09-09 15:05:52 +03:00
#include <QGuiApplication>
#include <QQmlApplicationEngine>
2018-11-14 23:15:36 +03:00
#include <QQmlContext>
2018-10-11 18:09:35 +03:00
#include "controller.h"
#include "diff.h"
2018-09-09 15:05:52 +03:00
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
2018-10-11 18:09:35 +03:00
2018-11-14 23:15:36 +03:00
//qmlRegisterType <Controller> ("Controller", 1, 0,"Controller");
qmlRegisterType <GuiObject> ();
qmlRegisterType <Diff> ();
2018-10-11 18:09:35 +03:00
2018-11-14 23:15:36 +03:00
auto root = engine.rootContext();
if (!root)
return -1;
Controller contr;
root->setContextProperty("contr", &contr);
2018-11-25 03:24:41 +03:00
engine.load(QUrl(QStringLiteral("qrc:/front-end/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
2018-09-09 15:05:52 +03:00
return app.exec();
}