diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-29 10:19:20 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-29 10:19:20 +0800 |
commit | d6c16f40490aef972df55ea101f9eef4eeb31f7b (patch) | |
tree | 3a72fb77c99cc14bbb15aa3aeceffd858db4e9dd | |
parent | 4a5bd6ae489a22ef1b20e2ec9d80a8846b5aba7d (diff) |
Move pushHome function to Login Password
-rw-r--r-- | LoginPassword.qml | 5 | ||||
-rw-r--r-- | controller.cxx | 8 | ||||
-rw-r--r-- | main.qml | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/LoginPassword.qml b/LoginPassword.qml index d306914..ad5f56c 100644 --- a/LoginPassword.qml +++ b/LoginPassword.qml @@ -3,6 +3,11 @@ import KelakonUser 0.1 import "larva/features" LoginPasswordForm { + objectName: "login" + function pushHome() { + pageView.push("Home.qml") + } + emailTextLabel.text: User.name passwordTextField.onTextChanged: if (!passwordTextField.text || !continueButton.enabled) diff --git a/controller.cxx b/controller.cxx index 43e7652..1b0e9f3 100644 --- a/controller.cxx +++ b/controller.cxx @@ -63,8 +63,12 @@ Controller::Controller(QObject* parent) : QObject{parent} connect(client, &Client::ticketSearched, taskList, &TicketList::update); - connect(taskList, &TicketList::updated, [appWindow]() { - QMetaObject::invokeMethod(appWindow, "pushHome"); + connect(client, &Client::loggedIn, [appWindow,this]() { + auto loginView = appWindow->findChild<QObject*>("login"); + connect(taskList, &TicketList::updated, [loginView]() { + QMetaObject::invokeMethod(loginView + , "pushHome"); + }); }); connect(appWindow, SIGNAL(ticketHistory(int)) @@ -6,9 +6,6 @@ ApplicationWindow { signal logIn(string name, string password) signal ticketHistory(int id) signal ticketNew(string queue, string requestor) - function pushHome() { - pageView.push("Home.qml") - } id: window visible: true |