diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-03 16:19:53 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-03 16:26:52 +0100 |
| commit | 0311bed34d80abe518f11838271e39d1615ebf67 (patch) | |
| tree | d89854d97ba7b326909e10027d863d677dc5b15d /main.cpp | |
| parent | fdb64c59865e4db76addfb8222f6421443e25240 (diff) | |
| download | yachat6-0311bed34d80abe518f11838271e39d1615ebf67.tar.gz | |
Import xxcc.{cpp,h} as yc.{cpp,h}
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -4,28 +4,19 @@ #include <QObject> #include <QVariant> #include <memory> -#include "test.h" +#include "yc.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); - QQmlApplicationEngine engine("qrc:/org/yachat/lib/Main.qml"); + QQmlApplicationEngine engine("qrc:/org/yachat/app/Main.qml"); -#if 0 - qRegisterMetaType<Test>("Test"); - - qmlRegisterType<Test>("org.yachat.lib", 1, 0, "Test"); -#endif -#if 1 - qmlRegisterSingletonType<Test>("org.yachat.lib", 1, 0, "Test", + qmlRegisterSingletonType<Yc>("org.yachat.app", 1, 0, "Yc", [](QQmlEngine *, QJSEngine *) -> QObject * { - return std::make_unique<Test>().release(); + return std::make_unique<Yc>().release(); } ); -#else - Test test; - engine.rootContext()->setContextProperty("Test", &test); -#endif + return app.exec(); } |
