diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-03-26 17:30:47 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-03-27 12:13:53 +0100 |
commit | 0613bf5d160e79476435da54f2cad2676de4a558 (patch) | |
tree | 4a1833bacb42aaeeabf9cfa277e9f38e2e788595 /src/widgets/widgets/qwidgettextcontrol.cpp | |
parent | d4a4202caaf1676e8ae49359594d60895ff45d20 (diff) |
QTextEdit: remove the cursor when a read-only textedit looses focus
A read-only text edit with Qt::TextSelectableByKeyboard shows a steady
cursor to indicate to users that they can select the text, but not edit
it. When the control receives focus, it doesn't turn on blinking, but
explicitly sets cursorOn to true.
When focus is lost, then cursorOn needs to be reset to false to make
the cursor disappear, even if the blinking (as indicated by the poorly
named cursorVisible variable) is not on.
Change-Id: I78408b5c50c6ede3f9a7128be7a31b9c6795cf9c
Fixes: QTBUG-83029
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qwidgettextcontrol.cpp')
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 45ab384036..2e302e3d9c 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2236,6 +2236,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e) #endif } else { setCursorVisible(false); + cursorOn = false; if (cursorIsFocusIndicator && e->reason() != Qt::ActiveWindowFocusReason |