TextEditor: keep suggestion when operating tooltip

Triggering the apply word action inside the suggestion tooltip moved the
focus out of the editor. The generated focus out event cleared the
suggestion so a user could always only apply one word before the
suggestion was reset.

Amends 039a1f8ff0

Change-Id: I9f40a3de75e7091f2b5172f9a299c8ac0fad7ecf
Reviewed-by: <lie@spyro-soft.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
David Schulz
2024-10-02 12:33:25 +02:00
parent e58907b703
commit 784ff8a884

View File

@@ -8326,7 +8326,8 @@ void TextEditorWidget::focusOutEvent(QFocusEvent *e)
viewport()->update(d->cursorUpdateRect(d->m_cursors)); viewport()->update(d->cursorUpdateRect(d->m_cursors));
} }
d->updateHighlights(); d->updateHighlights();
d->clearCurrentSuggestion(); if (!Utils::ToolTip::isVisible())
d->clearCurrentSuggestion();
} }
void TextEditorWidgetPrivate::maybeSelectLine() void TextEditorWidgetPrivate::maybeSelectLine()