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
This commit is contained in:
Thorbjørn Lindeijer
2010-04-15 19:07:05 +02:00
parent 02ebee6d23
commit 01a0ec161c

View File

@@ -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);
}
}