diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-27 18:28:12 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-27 18:28:12 +0100 |
commit | ce6990c3e742e0833df0561246554cf07a888efb (patch) | |
tree | 412380582040f5bb314eb90ae029b41a883aa439 /src/gui/kernel/qguiapplication.cpp | |
parent | 09e674849a40f5eb7e9f95fd2a952c621aec86d1 (diff) | |
parent | fa9bde7d3a12ede956339c570f7b32f95d231e57 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index e421f79e91..ded3788dbf 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -869,7 +869,7 @@ QWindowList QGuiApplication::topLevelWindows() /*! Returns the primary (or default) screen of the application. - This will be the screen where QWindows are shown, unless otherwise specified. + This will be the screen where QWindows are initially shown, unless otherwise specified. */ QScreen *QGuiApplication::primaryScreen() { @@ -3386,15 +3386,21 @@ void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object) { Q_Q(QGuiApplication); + QPlatformInputContext *inputContext = platformIntegration()->inputContext(); bool enabled = false; - if (object) { - QInputMethodQueryEvent query(Qt::ImEnabled); + if (object && inputContext) { + QInputMethodQueryEvent query(Qt::ImEnabled | Qt::ImHints); QGuiApplication::sendEvent(object, &query); enabled = query.value(Qt::ImEnabled).toBool(); + if (enabled) { + static const bool supportsHiddenText = inputContext->hasCapability(QPlatformInputContext::HiddenTextCapability); + const Qt::InputMethodHints hints = static_cast<Qt::InputMethodHints>(query.value(Qt::ImHints).toInt()); + if ((hints & Qt::ImhHiddenText) && !supportsHiddenText) + enabled = false; + } } QPlatformInputContextPrivate::setInputMethodAccepted(enabled); - QPlatformInputContext *inputContext = platformIntegration()->inputContext(); if (inputContext) inputContext->setFocusObject(object); emit q->focusObjectChanged(object); |