QLineEdit: Fix behavior of DeleteStartOfWord key

DeleteStartOfWord key behaves like Delete key when the cursor
is at the beginning of the line. Do nothing instead.

Task-number: QTBUG-65855
Change-Id: I56402961b44ec6fe3a382df68a76db36891c4522
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Alexander Volkov 2018-07-12 14:32:00 +03:00
parent b773a02318
commit 6f81dbe674
1 changed files with 2 additions and 1 deletions

View File

@ -1840,7 +1840,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
else if (event == QKeySequence::DeleteStartOfWord) {
if (!isReadOnly()) {
cursorWordBackward(true);
del();
if (hasSelectedText())
del();
}
} else if (event == QKeySequence::DeleteCompleteLine) {
if (!isReadOnly()) {