diff options
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(); } |
