summaryrefslogtreecommitdiff
path: root/main.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/main.cxx b/main.cxx
index c9e8691..ff184e7 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1,6 +1,5 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>
-#include <QtQml>
#include "user.hxx"
#include "tasklist.hxx"
#include "controller.hxx"
@@ -16,11 +15,16 @@ int main(int argc, char* argv[])
QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
- return new User{};
+ return new User;
});
- TaskList taskList;
- engine.rootContext()->setContextProperty("taskList", &taskList);
+ TaskList::typeId = qmlRegisterSingletonType<User>("KelakonUser", 0, 1, "TaskList"
+ , [](QQmlEngine *engine,
+ QJSEngine *scriptEngine) -> QObject* {
+ Q_UNUSED(engine)
+ Q_UNUSED(scriptEngine)
+ return new TaskList;
+ });
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
Controller controller{&engine};