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>
This commit is contained in:
parent
d4a4202caa
commit
0613bf5d16
@ -2236,6 +2236,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e)
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
setCursorVisible(false);
|
setCursorVisible(false);
|
||||||
|
cursorOn = false;
|
||||||
|
|
||||||
if (cursorIsFocusIndicator
|
if (cursorIsFocusIndicator
|
||||||
&& e->reason() != Qt::ActiveWindowFocusReason
|
&& e->reason() != Qt::ActiveWindowFocusReason
|
||||||
|
Loading…
x
Reference in New Issue
Block a user