diff options
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,6 +1,7 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QThread> +#include "user.hxx" #include "networkworker.hxx" int main(int argc, char* argv[]) @@ -13,6 +14,13 @@ int main(int argc, char* argv[]) QThread thread; worker.moveToThread(&thread); + qmlRegisterSingletonType<User>("id.co.darapsa.kelakon.user", 0, 1, "User", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + + User* user = new User{}; + return user; + }); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); thread.start(); |