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 8a7c373f8e)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Karim Pinter 2019-01-29 16:05:06 +02:00 committed by Andy Shaw
parent c21e2d5706
commit 68a2b3d46a
2 changed files with 18 additions and 8 deletions

View File

@ -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();
#if QT_CONFIG(qqnx_pps)
// Create/start the keyboard class.
m_virtualKeyboard = new QQnxVirtualKeyboardPps();
m_qpaInputContext = QPlatformInputContextFactory::create();
// 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);
#if QT_CONFIG(qqnx_pps)
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);
}
#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)
{

View File

@ -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;