summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cpphoverhandler.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-04-21 14:50:35 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-04-21 14:55:08 +0200
commit8999b35fcf8a89827106a2db486d28e274ab300c (patch)
tree8f3463b6a27248eac659cf6fdc6402a5eae50d2c /src/plugins/cppeditor/cpphoverhandler.cpp
parentc4dbe9530e9a671b722348d12a2b13da1e9e461f (diff)
downloadqt-creator-8999b35fcf8a89827106a2db486d28e274ab300c.tar.gz
Only escape the code tooltip when it is used as rich text
Since the fix in 01a0ec161cf5e814b53151a040afc2ac1acd69f8, sometimes &amp; would turn up in the tooltips due to them being escaped but not interpreted as HTML.
Diffstat (limited to 'src/plugins/cppeditor/cpphoverhandler.cpp')
-rw-r--r--src/plugins/cppeditor/cpphoverhandler.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index a2e270b3e1..2c91f5cba4 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -413,21 +413,17 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
}
}
- if (!formatTooltip.isEmpty()) {
+ if (!formatTooltip.isEmpty())
m_toolTip = formatTooltip;
- }
-
- if (!m_toolTip.isEmpty())
- m_toolTip = Qt::escape(m_toolTip);
if (!m_helpId.isEmpty() && !helpLinks.isEmpty()) {
if (showF1) {
m_toolTip = QString(QLatin1String("<table><tr><td valign=middle><nobr>%1</td>"
"<td><img src=\":/cppeditor/images/f1.png\"></td></tr></table>"))
- .arg(m_toolTip);
+ .arg(Qt::escape(m_toolTip));
}
editor->setContextHelpId(m_helpId);
} else if (!m_toolTip.isEmpty() && Qt::mightBeRichText(m_toolTip)) {
- m_toolTip = QString(QLatin1String("<nobr>%1")).arg(m_toolTip);
+ m_toolTip = QString(QLatin1String("<nobr>%1")).arg(Qt::escape(m_toolTip));
}
}