18int main(
int argc,
char *argv[])
20 QApplication app(argc, argv);
27 spdlog::info(
"Initialization");
34 QQmlApplicationEngine engine;
37 qmlRegisterType<CaptureMoment::UI::QMLPaintedImageItem>(
38 "CaptureMoment.UI.Rendering.Painted", 1, 0,
"QMLPaintedImageItem"
40 qmlRegisterType<CaptureMoment::UI::QMLSGSImageItem>(
41 "CaptureMoment.UI.Rendering.SGS", 1, 0,
"QMLSGSImageItem"
43 qmlRegisterType<CaptureMoment::UI::QMLRHIImageItem>(
44 "CaptureMoment.UI.Rendering.RHI", 1, 0,
"QMLRHIImageItem"
51 auto context = engine.rootContext();
53 spdlog::error(
"Failed to setup QML context");
60 &QQmlApplicationEngine::objectCreationFailed,
62 []() { QCoreApplication::exit(-1); },
69 engine.loadFromModule(
"CaptureMoment.desktop",
"DesktopMain");
71 if (engine.rootObjects().isEmpty()) {
72 spdlog::error(
"Failed to load QML module");
76 QObject* rootObject { engine.rootObjects().first() };
77 if (
auto* window { qobject_cast<QQuickWindow*>(rootObject) })
79 QObject::connect(window, &QQuickWindow::frameSwapped, window, [window, &splash]() {
82 }, Qt::SingleShotConnection);
static bool setupContext(QQmlContext *context)
Setup complete QML context with all objects.
int main(int argc, char *argv[])
Manages creation and setup of all C++ objects for QML.