summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-27 18:28:12 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-27 18:28:12 +0100
commitce6990c3e742e0833df0561246554cf07a888efb (patch)
tree412380582040f5bb314eb90ae029b41a883aa439 /src/gui/kernel/qguiapplication.cpp
parent09e674849a40f5eb7e9f95fd2a952c621aec86d1 (diff)
parentfa9bde7d3a12ede956339c570f7b32f95d231e57 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
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);