summaryrefslogtreecommitdiff
path: root/main.cxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-13 18:29:31 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-13 18:29:31 +0800
commit9ec42c7e9c4a96d54bbf526cbd93f07c78e2415e (patch)
tree422e087574a93d29edf689189c23b0949d4a3449 /main.cxx
parent7e4501b3af82360eb1415f3d5745f1b0c278f504 (diff)
Manage to show tasks
but the view is widened vertically yet.
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};