diff options
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index faa63cb400..53b2406fc1 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -883,7 +883,8 @@ void QWidgetTextControl::setTextCursor(const QTextCursor &cursor) const bool posChanged = cursor.position() != d->cursor.position(); const QTextCursor oldSelection = d->cursor; d->cursor = cursor; - d->cursorOn = d->hasFocus && (d->interactionFlags & Qt::TextEditable); + d->cursorOn = d->hasFocus + && (d->interactionFlags & (Qt::TextSelectableByKeyboard | Qt::TextEditable)); d->_q_updateCurrentCharFormatAndSelection(); ensureCursorVisible(); d->repaintOldAndNewSelection(oldSelection); @@ -2138,7 +2139,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e) #ifdef QT_KEYPAD_NAVIGATION if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason))) { #endif - cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard); + cursorOn = (interactionFlags & (Qt::TextSelectableByKeyboard | Qt::TextEditable)); if (interactionFlags & Qt::TextEditable) { setBlinkingCursorEnabled(true); } |