From 95217d0584cb76a8a50031ff658dd95f56af0c0e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 15 Dec 2014 19:40:04 +0100 Subject: [PATCH] - add parameter QObject* in initKeyEventManager. --- mix/AppContext.cpp | 4 ++-- mix/AppContext.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mix/AppContext.cpp b/mix/AppContext.cpp index 5b8b76139..92b3f4c0a 100644 --- a/mix/AppContext.cpp +++ b/mix/AppContext.cpp @@ -52,9 +52,9 @@ dev::eth::Client* AppContext::getEthereumClient() return m_webThree->ethereum(); } -void AppContext::initKeyEventManager() +void AppContext::initKeyEventManager(QObject* _res) { - QObject* mainContent = m_applicationEngine->rootObjects().at(0)->findChild("mainContent", Qt::FindChildrenRecursively); + QObject* mainContent = _res->findChild("mainContent", Qt::FindChildrenRecursively); if (mainContent) QObject::connect(mainContent, SIGNAL(keyPressed(QVariant)), m_keyEventManager.get(), SLOT(keyPressed(QVariant))); else diff --git a/mix/AppContext.h b/mix/AppContext.h index ce00205d8..baa2905ba 100644 --- a/mix/AppContext.h +++ b/mix/AppContext.h @@ -47,7 +47,7 @@ public: static void setApplicationContext(QQmlApplicationEngine* _engine); QQmlApplicationEngine* appEngine(); dev::eth::Client* getEthereumClient(); - void initKeyEventManager(); + void initKeyEventManager(QObject* _obj); KeyEventManager* getKeyEventManager(); void displayMessageDialog(QString _title, QString _message); @@ -59,7 +59,7 @@ private: public slots: void quitApplication() { delete Instance; } - void resourceLoaded(QObject* _obj, QUrl _url) { Q_UNUSED(_obj); Q_UNUSED(_url); initKeyEventManager(); } + void resourceLoaded(QObject* _obj, QUrl _url) { Q_UNUSED(_url); initKeyEventManager(_obj); } }; }