summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-04 14:55:41 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-04 14:55:41 +0800
commit19aab4eadb8936d286b06f5b1985113c8edcd65e (patch)
tree3ab8c9dbe3e37423221aaaea3325355bb45d611b
parente2a0b4a8eb1efa5e1f3df6473ef339ffc6634f72 (diff)
The user singleton can lazy load for now
-rw-r--r--main.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.cxx b/main.cxx
index 23ba4ac..ac11c55 100644
--- a/main.cxx
+++ b/main.cxx
@@ -9,14 +9,12 @@ int main(int argc, char* argv[])
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
- auto typeId = qmlRegisterSingletonType<User>("id.co.darapsa.kelakon.user", 0, 1, "User", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
+ qmlRegisterSingletonType<User>("id.co.darapsa.kelakon.user", 0, 1, "User", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new User{};
});
- auto user = engine.singletonInstance<User*>(typeId);
- Q_UNUSED(user)
- typeId = qmlRegisterSingletonType<User>("id.co.darapsa.kelakon.rtclient", 0, 1, "RTClient", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
+ auto typeId = qmlRegisterSingletonType<User>("id.co.darapsa.kelakon.rtclient", 0, 1, "RTClient", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new Controller{};