summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorKarim Pinter <karim.pinter@qt.io>2019-01-29 16:05:06 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-03-14 06:46:06 +0000
commit68a2b3d46a31167ae738f559b3b48d1db7f20dd0 (patch)
tree8e2391b0715f0aba7f5ccaca9cb01bce13f71f63 /src/plugins/platforms
parentc21e2d5706ca50fb4fccf1eae70b76f0e278db99 (diff)
QNX QPA: Add support for Qt Virtual Keyboard
If the QT_IM_MODULE environment variable is set, then it loads the IM module accordingly, otherwise it is using the PPS one, if it is available. Task-number: QTBUG-54576 Change-Id: Icb8b474805053d8297029096365783c2cabc2cbc Reviewed-by: Samuli Piippo <samuli.piippo@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> (cherry picked from commit 8a7c373f8e745427d5fe7afc08d698837b7b8f2b) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp23
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h1
2 files changed, 17 insertions, 7 deletions
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index db79780407..a996e765c4 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -72,6 +72,9 @@
# endif
#endif
+#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qplatforminputcontext.h>
+
#include "private/qgenericunixfontdatabase_p.h"
#include "private/qgenericunixeventdispatcher_p.h"
@@ -152,6 +155,7 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
, m_inputContext(0)
, m_buttonsNotifier(new QQnxButtonEventNotifier())
#endif
+ , m_qpaInputContext(0)
, m_services(0)
, m_fontDatabase(new QGenericUnixFontDatabase())
, m_eventDispatcher(createUnixEventDispatcher())
@@ -194,13 +198,17 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
m_screenEventHandler->setScreenEventThread(m_screenEventThread);
m_screenEventThread->start();
+ m_qpaInputContext = QPlatformInputContextFactory::create();
+
#if QT_CONFIG(qqnx_pps)
- // Create/start the keyboard class.
- m_virtualKeyboard = new QQnxVirtualKeyboardPps();
+ if (!m_qpaInputContext) {
+ // Create/start the keyboard class.
+ m_virtualKeyboard = new QQnxVirtualKeyboardPps();
- // 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_virtualKeyboard, "start", Qt::QueuedConnection);
+ // 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_virtualKeyboard, "start", Qt::QueuedConnection);
+ }
#endif
#if QT_CONFIG(qqnx_pps)
@@ -281,6 +289,7 @@ QQnxIntegration::~QQnxIntegration()
// Destroy input context
delete m_inputContext;
#endif
+ delete m_qpaInputContext;
// Destroy the keyboard class.
delete m_virtualKeyboard;
@@ -397,13 +406,13 @@ QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLCont
}
#endif
-#if QT_CONFIG(qqnx_pps)
QPlatformInputContext *QQnxIntegration::inputContext() const
{
qIntegrationDebug();
+ if (m_qpaInputContext)
+ return m_qpaInputContext;
return m_inputContext;
}
-#endif
void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 4a6f15fc08..366556dc4b 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -153,6 +153,7 @@ private:
QQnxInputContext *m_inputContext;
QQnxButtonEventNotifier *m_buttonsNotifier;
#endif
+ QPlatformInputContext *m_qpaInputContext;
QQnxServices *m_services;
QPlatformFontDatabase *m_fontDatabase;
mutable QAbstractEventDispatcher *m_eventDispatcher;