swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 1 | #include "IdeMain.h" |
| 2 | |
| 3 | #include <QQmlApplicationEngine> |
| 4 | #include <QQuickStyle> |
| 5 | |
swissChili | 25620b0 | 2022-02-23 17:15:16 -0800 | [diff] [blame^] | 6 | #include "CellModel.h" |
| 7 | |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 8 | int ideMain(QGuiApplication *app) |
| 9 | { |
| 10 | QQmlApplicationEngine engine; |
| 11 | |
| 12 | // This is done implicitly now. |
| 13 | // registerTypes(&engine); |
| 14 | |
| 15 | QQuickStyle::setStyle("Material"); |
| 16 | |
swissChili | 25620b0 | 2022-02-23 17:15:16 -0800 | [diff] [blame^] | 17 | qRegisterMetaType<CellModel>(); |
| 18 | qRegisterMetaType<CellModel *>(); |
| 19 | |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 20 | const QUrl url(QStringLiteral("qrc:/qml/main.qml")); |
| 21 | QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, |
| 22 | app, [url](QObject *obj, const QUrl &objUrl) |
| 23 | { |
| 24 | if (!obj && url == objUrl) |
| 25 | QCoreApplication::exit(-1); |
| 26 | }, Qt::QueuedConnection); |
| 27 | engine.load(url); |
| 28 | |
| 29 | return app->exec(); |
| 30 | } |