summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxintegration.cpp
diff options
context:
space:
mode:
authorKevin Krammer <kevin.krammer.qnx@kdab.com>2012-03-20 11:27:52 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-21 20:47:54 +0100
commit9dc86ac0f2d019f93665c1ae0e3c2cd33fd88bce (patch)
treecb8b54487c43d9838ce025a36cf757d675edc4a0 /src/plugins/platforms/qnx/qqnxintegration.cpp
parent3ed12e4b26bab091821ee3827eb44f61d22f47d7 (diff)
Use main thread event loop for navigator event processing
Removes the need for an extra thread by creating the event handler's socket notifier in the context of the main thread. Change-Id: If8c7bb986074083b5b9a7b9c96734a970ba32f92 Reviewed-by: Sean Harmer <sh@theharmers.co.uk> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxintegration.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 2811661269..cb7f14f963 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -43,7 +43,7 @@
#include "qqnxeventthread.h"
#include "qqnxglbackingstore.h"
#include "qqnxglcontext.h"
-#include "qqnxnavigatorthread.h"
+#include "qqnxnavigatoreventhandler.h"
#include "qqnxrasterbackingstore.h"
#include "qqnxscreen.h"
#include "qqnxwindow.h"
@@ -77,7 +77,7 @@ QMutex QQnxIntegration::ms_windowMapperMutex;
QQnxIntegration::QQnxIntegration()
: QPlatformIntegration()
, m_eventThread(0)
- , m_navigatorThread(0)
+ , m_navigatorEventHandler(0)
, m_inputContext(0)
, m_fontDatabase(new QGenericUnixFontDatabase())
, m_paintUsingOpenGL(false)
@@ -109,9 +109,15 @@ QQnxIntegration::QQnxIntegration()
m_eventThread = new QQnxEventThread(m_screenContext, *QQnxScreen::primaryDisplay());
m_eventThread->start();
- // Create/start navigator thread
- m_navigatorThread = new QQnxNavigatorThread(*QQnxScreen::primaryDisplay());
- m_navigatorThread->start();
+ // Create/start navigator event handler
+ // Not on BlackBerry, it has specialised event dispatcher which also handles navigator events
+#ifndef Q_OS_BLACKBERRY
+ m_navigatorEventHandler = new QQnxNavigatorEventHandler(*QQnxScreen::primaryDisplay());
+
+ // delay invocation of start() to the time the event loop is up and running
+ // needed to have the QThread internals of the main thread properly initialized
+ QMetaObject::invokeMethod(m_navigatorEventHandler, "start", Qt::QueuedConnection);
+#endif
// Create/start the keyboard class.
QQnxVirtualKeyboard::instance();
@@ -137,7 +143,7 @@ QQnxIntegration::~QQnxIntegration()
delete m_eventThread;
// Stop/destroy navigator thread
- delete m_navigatorThread;
+ delete m_navigatorEventHandler;
// Destroy all displays
QQnxScreen::destroyDisplays();