From 06f744d8f3d458bde5d213ac0b9981ff0891153f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Wed, 25 Sep 2019 09:56:48 +0800 Subject: Simplify the QML logics entrance --- controller.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'controller.cxx') diff --git a/controller.cxx b/controller.cxx index 8447242..9908fb8 100644 --- a/controller.cxx +++ b/controller.cxx @@ -26,7 +26,6 @@ Controller::Controller(QObject* parent) : QObject{parent} auto engine = static_cast(parent); auto rootObjects = engine->rootObjects(); auto appWindow = rootObjects[0]; - auto onboardingView = appWindow->findChild("onboarding"); using RTClient::User; auto typeId = qmlRegisterSingletonType("KelakonUser", 0, 1, "User" , [](QQmlEngine *engine @@ -39,7 +38,7 @@ Controller::Controller(QObject* parent) : QObject{parent} taskList = new RTClient::TicketList; engine->rootContext()->setContextProperty("taskList", taskList); - connect(onboardingView, SIGNAL(logIn(QString, QString)) + connect(appWindow, SIGNAL(logIn(QString, QString)) , client, SLOT(logIn(QString, QString))); connect(client, SIGNAL(loggedIn(QString)) @@ -56,9 +55,9 @@ Controller::Controller(QObject* parent) : QObject{parent} connect(client, SIGNAL(ticketSearched(rtclient_ticketlist*)) , taskList, SLOT(update(rtclient_ticketlist*))); - connect(taskList, SIGNAL(updated()), onboardingView, SLOT(pushHome())); + connect(taskList, SIGNAL(updated()), appWindow, SLOT(pushHome())); - connect(onboardingView, SIGNAL(ticketNew(QString, QString)) + connect(appWindow, SIGNAL(ticketNew(QString, QString)) , client, SLOT(ticketNew(QString, QString))); thread.start(); -- cgit v1.2.3