From 01a0ec161cf5e814b53151a040afc2ac1acd69f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Thu, 15 Apr 2010 19:07:05 +0200 Subject: [PATCH] Fixed unwanted wrapping of code editor tooltips Turns out the <nobr> actually caused wrapping in some cases because the tag made the QToolTip turn on its wrapping feature due to the text being rich text. So avoid adding it to plain text tooltips unnecessarily. Reviewed-by: hunger Task-number: QTCREATORBUG-1169 --- src/plugins/cppeditor/cpphoverhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index a4fd089c6a5..a2e270b3e10 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -427,7 +427,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in .arg(m_toolTip); } editor->setContextHelpId(m_helpId); - } else if (!m_toolTip.isEmpty()) { + } else if (!m_toolTip.isEmpty() && Qt::mightBeRichText(m_toolTip)) { m_toolTip = QString(QLatin1String("<nobr>%1")).arg(m_toolTip); } } -- GitLab