This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/main.cpp

27 lines
683 B
C++
Raw Normal View History

2021-01-28 17:06:40 +08:00
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QDebug>
2019-12-04 15:51:46 +08:00
2021-01-28 17:06:40 +08:00
#include "engine/js_engine.h"
2019-12-19 19:54:58 +08:00
#include "async/async_result.h"
2019-12-04 15:51:46 +08:00
int main(int argc, char *argv[])
{
2021-01-28 17:06:40 +08:00
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
2019-12-04 16:44:30 +08:00
2021-01-28 17:06:40 +08:00
QGuiApplication app(argc, argv);
2019-12-04 15:51:46 +08:00
2021-01-28 17:06:40 +08:00
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
JSEngine jsEngine;
2019-12-19 19:54:58 +08:00
2019-12-04 15:51:46 +08:00
return app.exec();
}