From 6a4bf73c07b034a0f9d07cb617d23e92ca778dd1 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 23 Feb 2012 15:57:14 +0200 Subject: Added some convenience API for platform input contexts QPlatformInputContext now gets notified on changed focus and has inputMethodAccepted() telling whether current focus object accepts input method events. Also adapted IBus plugin to use this. Key event filtering for focused objects without input method support got fixed by the change. Change-Id: I6910aa6af2459d752a5763f0ae88fa8c34e5b165 Reviewed-by: Joona Petrell --- src/gui/kernel/qplatforminputcontext_qpa.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/gui/kernel/qplatforminputcontext_qpa.h') diff --git a/src/gui/kernel/qplatforminputcontext_qpa.h b/src/gui/kernel/qplatforminputcontext_qpa.h index c7d823d662..5e8060c6e0 100644 --- a/src/gui/kernel/qplatforminputcontext_qpa.h +++ b/src/gui/kernel/qplatforminputcontext_qpa.h @@ -48,13 +48,13 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE - -class QWindow; -class QMouseEvent; +class QPlatformInputContextPrivate; class Q_GUI_EXPORT QPlatformInputContext : public QObject { Q_OBJECT + Q_DECLARE_PRIVATE(QPlatformInputContext) + public: QPlatformInputContext(); virtual ~QPlatformInputContext(); @@ -81,6 +81,14 @@ public: void emitLocaleChanged(); virtual Qt::LayoutDirection inputDirection() const; void emitInputDirectionChanged(Qt::LayoutDirection newDirection); + + virtual void setFocusObject(QObject *object); + bool inputMethodAccepted() const; + +private: + friend class QGuiApplication; + friend class QGuiApplicationPrivate; + friend class QInputMethod; }; QT_END_NAMESPACE -- cgit v1.2.3