diff options
author | Zhang Hao <zhanghao@uniontech.com> | 2020-12-18 14:12:44 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-03 11:29:19 +0000 |
commit | 0cf2f844760170ec8fd74591b298cef8ccf7c51c (patch) | |
tree | 0291372fd0529f2fe0e84ba236ef72a0938f0e81 /src/widgets/widgets | |
parent | 683b673c501da1cef17b8c74e30ed74a37c7d22b (diff) |
QLineEdit Cursor show white area
fix QLineEdit Cursor Rect and InputMask area overlapping,
the cursor rect area is white. when inputMask is set,we don't
need draw cursor.
Fixes: QTBUG-89578
Change-Id: Ibec7f8f1f7331a12438fd821c2002903260da10a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 795ea19ca0a7e484793655b35f19de8dbc88e987)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 0a74487a4c..a9452a60b6 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -2082,8 +2082,10 @@ void QLineEdit::paintEvent(QPaintEvent *) // Asian users see an IM selection text as cursor on candidate // selection phase of input method, so the ordinary cursor should be - // invisible if we have a preedit string. - if (d->cursorVisible && !d->control->isReadOnly()) + // invisible if we have a preedit string. another condition is when inputmask + // isn't empty,we don't need draw cursor,because cursor and character overlaping + // area is white. + if (d->cursorVisible && !d->control->isReadOnly() && d->control->inputMask().isEmpty()) flags |= QWidgetLineControl::DrawCursor; d->control->setCursorWidth(style()->pixelMetric(QStyle::PM_TextCursorWidth, &panel)); |