diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2011-09-08 17:22:55 +0300 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-09-08 21:40:40 +0200 |
commit | 8be11227100498d7098eb7f39bbbe1e7ac6b01cf (patch) | |
tree | 27a7b596fd69e014a8e4736fb9fd9d037603d643 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 7ad91ad9ca89d868d59a1fcff85349cc9786f99a (diff) |
Add plugin mechanism to load platform input contexts
Change-Id: I6e74fd395325445420efce4adf13e89abe8177ee
Reviewed-on: http://codereview.qt-project.org/4482
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 3d181dcf0c..316d28ea3f 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -63,7 +63,8 @@ #endif #if defined(XCB_USE_IBUS) -#include "QtPlatformSupport/qibusplatforminputcontext.h" +#include <private/qplatforminputcontextfactory_qpa_p.h> +#include <qplatforminputcontext_qpa.h> #endif #if defined(XCB_USE_GLX) @@ -102,12 +103,15 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters) m_inputContext = 0; #if defined(XCB_USE_IBUS) - QIBusPlatformInputContext *context = new QIBusPlatformInputContext; - if (context->isValid()) { - m_inputContext = context; - } else { - delete context; + QPlatformInputContext *platformInputContext = QPlatformInputContextFactory::create("ibus"); + if (platformInputContext) { + QVariant value; + QMetaObject::invokeMethod(platformInputContext, "isValid", Qt::DirectConnection, Q_RETURN_ARG(QVariant, value)); + if (value.toBool()) + m_inputContext = platformInputContext; } + if (platformInputContext && !m_inputContext) + delete platformInputContext; #endif } |