Browse Source

- add parameter QObject* in initKeyEventManager.

cl-refactor
yann300 10 years ago
parent
commit
95217d0584
  1. 4
      mix/AppContext.cpp
  2. 4
      mix/AppContext.h

4
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<QObject*>("mainContent", Qt::FindChildrenRecursively);
QObject* mainContent = _res->findChild<QObject*>("mainContent", Qt::FindChildrenRecursively);
if (mainContent)
QObject::connect(mainContent, SIGNAL(keyPressed(QVariant)), m_keyEventManager.get(), SLOT(keyPressed(QVariant)));
else

4
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); }
};
}

Loading…
Cancel
Save