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>
This commit is contained in:
parent
c21e2d5706
commit
68a2b3d46a
@ -72,6 +72,9 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <qpa/qplatforminputcontextfactory_p.h>
|
||||||
|
#include <qpa/qplatforminputcontext.h>
|
||||||
|
|
||||||
#include "private/qgenericunixfontdatabase_p.h"
|
#include "private/qgenericunixfontdatabase_p.h"
|
||||||
#include "private/qgenericunixeventdispatcher_p.h"
|
#include "private/qgenericunixeventdispatcher_p.h"
|
||||||
|
|
||||||
@ -152,6 +155,7 @@ QQnxIntegration::QQnxIntegration(const QStringList ¶mList)
|
|||||||
, m_inputContext(0)
|
, m_inputContext(0)
|
||||||
, m_buttonsNotifier(new QQnxButtonEventNotifier())
|
, m_buttonsNotifier(new QQnxButtonEventNotifier())
|
||||||
#endif
|
#endif
|
||||||
|
, m_qpaInputContext(0)
|
||||||
, m_services(0)
|
, m_services(0)
|
||||||
, m_fontDatabase(new QGenericUnixFontDatabase())
|
, m_fontDatabase(new QGenericUnixFontDatabase())
|
||||||
, m_eventDispatcher(createUnixEventDispatcher())
|
, m_eventDispatcher(createUnixEventDispatcher())
|
||||||
@ -194,13 +198,17 @@ QQnxIntegration::QQnxIntegration(const QStringList ¶mList)
|
|||||||
m_screenEventHandler->setScreenEventThread(m_screenEventThread);
|
m_screenEventHandler->setScreenEventThread(m_screenEventThread);
|
||||||
m_screenEventThread->start();
|
m_screenEventThread->start();
|
||||||
|
|
||||||
#if QT_CONFIG(qqnx_pps)
|
m_qpaInputContext = QPlatformInputContextFactory::create();
|
||||||
// Create/start the keyboard class.
|
|
||||||
m_virtualKeyboard = new QQnxVirtualKeyboardPps();
|
|
||||||
|
|
||||||
// delay invocation of start() to the time the event loop is up and running
|
#if QT_CONFIG(qqnx_pps)
|
||||||
// needed to have the QThread internals of the main thread properly initialized
|
if (!m_qpaInputContext) {
|
||||||
QMetaObject::invokeMethod(m_virtualKeyboard, "start", Qt::QueuedConnection);
|
// 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
|
#endif
|
||||||
|
|
||||||
#if QT_CONFIG(qqnx_pps)
|
#if QT_CONFIG(qqnx_pps)
|
||||||
@ -281,6 +289,7 @@ QQnxIntegration::~QQnxIntegration()
|
|||||||
// Destroy input context
|
// Destroy input context
|
||||||
delete m_inputContext;
|
delete m_inputContext;
|
||||||
#endif
|
#endif
|
||||||
|
delete m_qpaInputContext;
|
||||||
|
|
||||||
// Destroy the keyboard class.
|
// Destroy the keyboard class.
|
||||||
delete m_virtualKeyboard;
|
delete m_virtualKeyboard;
|
||||||
@ -397,13 +406,13 @@ QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLCont
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if QT_CONFIG(qqnx_pps)
|
|
||||||
QPlatformInputContext *QQnxIntegration::inputContext() const
|
QPlatformInputContext *QQnxIntegration::inputContext() const
|
||||||
{
|
{
|
||||||
qIntegrationDebug();
|
qIntegrationDebug();
|
||||||
|
if (m_qpaInputContext)
|
||||||
|
return m_qpaInputContext;
|
||||||
return m_inputContext;
|
return m_inputContext;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void QQnxIntegration::moveToScreen(QWindow *window, int screen)
|
void QQnxIntegration::moveToScreen(QWindow *window, int screen)
|
||||||
{
|
{
|
||||||
|
@ -153,6 +153,7 @@ private:
|
|||||||
QQnxInputContext *m_inputContext;
|
QQnxInputContext *m_inputContext;
|
||||||
QQnxButtonEventNotifier *m_buttonsNotifier;
|
QQnxButtonEventNotifier *m_buttonsNotifier;
|
||||||
#endif
|
#endif
|
||||||
|
QPlatformInputContext *m_qpaInputContext;
|
||||||
QQnxServices *m_services;
|
QQnxServices *m_services;
|
||||||
QPlatformFontDatabase *m_fontDatabase;
|
QPlatformFontDatabase *m_fontDatabase;
|
||||||
mutable QAbstractEventDispatcher *m_eventDispatcher;
|
mutable QAbstractEventDispatcher *m_eventDispatcher;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user