From 298921be2d420e3aadafb9304459b9cead6ec20f Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 2 Oct 2023 21:58:23 +0200 Subject: [PATCH] CMakePM: Do not show the same tooltip on mouse pointer change Let's say you move the mouse left and right on the keyword, we shouldn't flicker showing the same tooltip to the new position. Change-Id: I45b69578d377384422535ce5f33f81bc916a42e2 Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 325cfb94f6b..1c836594d08 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -476,15 +476,16 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget helpCategory, word); - setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); + setPriority(!m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); } void CMakeHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) { - if (!m_helpToolTip.isEmpty()) + if (!m_helpToolTip.isEmpty() && toolTip() != m_helpToolTip) Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget, m_contextHelp); - else + else if (m_helpToolTip.isEmpty()) Utils::ToolTip::hide(); + setToolTip(m_helpToolTip); } //