From: Paul Olav Tvete Date: Wed, 10 Dec 2014 14:11:59 +0000 (+0100) Subject: Input method support for QQuickWidget X-Git-Tag: v5.4.1~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4af79ebc4ebd54c175fcc02476a30c760153baa;p=platform%2Fupstream%2Fqtdeclarative.git Input method support for QQuickWidget Make sure QGuiApplication::focusObject() returns the QQuickItem that has focus, and forward input method events. Task-number: QTBUG-42677 Change-Id: Ic07f93a2529c3dde67272b489bdc61fd25582a69 Reviewed-by: Laszlo Agocs Reviewed-by: Jørgen Lind --- diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 83fe586..6143e4e 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -246,6 +246,11 @@ QImage QQuickWidgetPrivate::grabFramebuffer() return renderControl->grab(); } +QObject *QQuickWidgetPrivate::focusObject() +{ + return offscreenWindow ? offscreenWindow->focusObject() : 0; +} + /*! \module QtQuickWidgets \title Qt Quick Widgets C++ Classes @@ -1086,6 +1091,9 @@ bool QQuickWidget::event(QEvent *e) e->accept(); return true; #endif + case QEvent::InputMethod: + case QEvent::InputMethodQuery: + case QEvent::TouchBegin: case QEvent::TouchEnd: case QEvent::TouchUpdate: diff --git a/src/quickwidgets/qquickwidget_p.h b/src/quickwidgets/qquickwidget_p.h index 2ff9601..57782a6 100644 --- a/src/quickwidgets/qquickwidget_p.h +++ b/src/quickwidgets/qquickwidget_p.h @@ -81,6 +81,8 @@ public: void destroyContext(); void handleContextCreationFailure(const QSurfaceFormat &format, bool isEs); + QObject *focusObject() Q_DECL_OVERRIDE; + GLuint textureId() const Q_DECL_OVERRIDE; QImage grabFramebuffer() Q_DECL_OVERRIDE;