summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTang Haixiang <tanghaixiang@uniontech.com>2020-09-23 13:50:59 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-20 07:52:52 +0000
commit12ef53e0d311e830542bdec456f59c52dafe2afb (patch)
treea5d4feb9979f471cf1d18ceac346b60483d72425 /src
parent2cfdbd62be950a5b2c512d64d7dd6f7060c11f7a (diff)
Always update the input method when QLineEdit receives focus
The line edit receiving focus might require different input method capabilities (e.g. be a password edit), so the input method needs to be refreshed when focus is received. This implicitly happens on tab focus when the text is selected or the cursor is moved within an input mask, but neither of those might happen, and for click-focus it never happened. Fixes: QTBUG-86846 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I47c5275d3a9d4d190ebce64269a345431346c17c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d5e8efd8cb02876dc314da0579d33af39ba38495) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qlineedit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 29053c4ade..958b784c50 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -1892,8 +1892,11 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
d->control->moveCursor(d->control->nextMaskBlank(0));
else if (!d->control->hasSelectedText())
selectAll();
+ else
+ updateMicroFocus();
} else if (e->reason() == Qt::MouseFocusReason) {
d->clickCausedFocus = 1;
+ updateMicroFocus();
}
#ifdef QT_KEYPAD_NAVIGATION
if (!QApplicationPrivate::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) {