Commit a6c6b2c4 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed macro tooltip overriding type information

The macro tooltip is supposed to be a fallback, since otherwise you
won't be able to see type information for macro parameters.

Reviewed-by: Roberto Raggi
parent 9c9308b9
......@@ -175,15 +175,6 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
break;
}
}
if (m_toolTip.isEmpty()) {
foreach (const Document::MacroUse use, doc->macroUses()) {
if (use.contains(pos)) {
m_toolTip = use.macro().toString();
break;
}
}
}
}
if (m_toolTip.isEmpty()) {
......@@ -240,6 +231,15 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
}
}
if (doc && m_toolTip.isEmpty()) {
foreach (const Document::MacroUse &use, doc->macroUses()) {
if (use.contains(pos)) {
m_toolTip = use.macro().toString();
break;
}
}
}
if (m_helpEngineNeedsSetup
&& m_helpEngine->registeredDocumentations().count() > 0) {
m_helpEngine->setupData();
......@@ -248,7 +248,8 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
if (!m_helpId.isEmpty() && !m_helpEngine->linksForIdentifier(m_helpId).isEmpty()) {
m_toolTip = QString(QLatin1String("<table><tr><td valign=middle><nobr>%1</td>"
"<td><img src=\":/cpptools/images/f1.svg\"></td></tr></table>")).arg(Qt::escape(m_toolTip));
"<td><img src=\":/cpptools/images/f1.svg\"></td></tr></table>"))
.arg(Qt::escape(m_toolTip));
editor->setContextHelpId(m_helpId);
} else if (!m_toolTip.isEmpty()) {
m_toolTip = QString(QLatin1String("<nobr>%1")).arg(Qt::escape(m_toolTip));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment