blob: caa0c8514c64fe8cf521b13fcd1e7c6d5ef37640 [file] [log] [blame]
#include "IdeMain.h"
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#include "CellModel.h"
int ideMain(Application *app)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QQmlApplicationEngine engine;
QQuickStyle::setStyle("Material");
qRegisterMetaType<CellModel>();
qRegisterMetaType<CellModel *>();
const QUrl url(QStringLiteral("qrc:/qml/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);
return app->exec();
}