From 2a237ac200a60daab490b0e1339a385bcc817d8c Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 29 Jan 2026 22:23:13 +0100 Subject: First commit --- main.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..c0aab91 --- /dev/null +++ b/main.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include +#include +#include "test.h" + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine("qrc:/org/yachat/lib/Main.qml"); + +#if 0 + qRegisterMetaType("Test"); + + qmlRegisterType("org.yachat.lib", 1, 0, "Test"); +#endif +#if 1 + qmlRegisterSingletonType("org.yachat.lib", 1, 0, "Test", + [](QQmlEngine *, QJSEngine *) -> QObject * + { + return std::make_unique().release(); + } + ); +#else + Test test; + engine.rootContext()->setContextProperty("Test", &test); +#endif + return app.exec(); +} -- cgit v1.2.3