summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-06 14:43:13 +0100
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-06 14:43:13 +0100
commit233502a79542006fe1800bc0865c0a2fdc52af86 (patch)
treef7c76d637aa370010bf08d7d4ded275461e8c9bc
parent903457ee6954e40ff41aa01e19e8f6ccbb5c8384 (diff)
downloadqt-creator-233502a79542006fe1800bc0865c0a2fdc52af86.tar.gz
Fixed tooltips for enumerators
The helpId was working but the tooltip text was empty. Reviewed-by: Roberto
-rw-r--r--src/libs/cplusplus/TypePrettyPrinter.cpp2
-rw-r--r--src/plugins/cppeditor/cpphoverhandler.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp
index 2784d9d695..31bf658ad3 100644
--- a/src/libs/cplusplus/TypePrettyPrinter.cpp
+++ b/src/libs/cplusplus/TypePrettyPrinter.cpp
@@ -92,6 +92,8 @@ QString TypePrettyPrinter::operator()(const FullySpecifiedType &type, const QStr
if (ch.isLetterOrNumber() || ch == QLatin1Char('_'))
text += QLatin1Char(' ');
text += _name;
+ } else {
+ text += name;
}
(void) switchName(previousName);
return text;
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 5059a92d8b..b814ed291a 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -258,6 +258,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
if (!types.isEmpty()) {
FullySpecifiedType firstType = types.first().first;
+ Symbol *symbol = types.first().second;
FullySpecifiedType docType = firstType;
if (const PointerType *pt = firstType->asPointerType()) {
@@ -266,8 +267,8 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
docType = rt->elementType();
}
- m_helpId = buildHelpId(docType, types.first().second);
- QString displayName = buildHelpId(firstType, types.first().second);
+ m_helpId = buildHelpId(docType, symbol);
+ QString displayName = buildHelpId(firstType, symbol);
if (!firstType->isClass() && !firstType->isNamedType()) {
Overview overview;
@@ -297,7 +298,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
m_helpEngineNeedsSetup = false;
}
- if (! m_toolTip.isEmpty())
+ if (!m_toolTip.isEmpty())
m_toolTip = Qt::escape(m_toolTip);
if (!m_helpId.isEmpty() && !m_helpEngine->linksForIdentifier(m_helpId).isEmpty()) {