From 784ff8a8841e1af4f26680c216173499644adce9 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 2 Oct 2024 12:33:25 +0200 Subject: [PATCH] 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 039a1f8ff09991fdf92802794d804a4cc94c06eb Change-Id: I9f40a3de75e7091f2b5172f9a299c8ac0fad7ecf Reviewed-by: Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 3e1329096b7..52aefa4305d 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8326,7 +8326,8 @@ void TextEditorWidget::focusOutEvent(QFocusEvent *e) viewport()->update(d->cursorUpdateRect(d->m_cursors)); } d->updateHighlights(); - d->clearCurrentSuggestion(); + if (!Utils::ToolTip::isVisible()) + d->clearCurrentSuggestion(); } void TextEditorWidgetPrivate::maybeSelectLine()