summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cpphoverhandler.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-10-09 10:27:54 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2009-10-09 10:27:54 +0200
commit926144dceae4c83ead2675776ec463d428e0b23d (patch)
tree7e221bfaa6edea370502b91e3b3971520a6c5973 /src/plugins/cppeditor/cpphoverhandler.cpp
parent8d9ccaff01e8c5ff16fc9521cd3af73beb7b1443 (diff)
downloadqt-creator-926144dceae4c83ead2675776ec463d428e0b23d.tar.gz
Prefer Classes to constructors when building the `help id'
Diffstat (limited to 'src/plugins/cppeditor/cpphoverhandler.cpp')
-rw-r--r--src/plugins/cppeditor/cpphoverhandler.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 6ec74f1384..99e87288ea 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -337,6 +337,14 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
firstType = resolve(firstType, typeOfExpression.lookupContext(),
&resolvedSymbol, &resolvedName);
+ if (resolvedSymbol && resolvedSymbol->scope()->isClassScope()) {
+ Class *enclosingClass = resolvedSymbol->scope()->owner()->asClass();
+ if (Identifier *id = enclosingClass->identifier()) {
+ if (id->isEqualTo(resolvedSymbol->identifier()))
+ resolvedSymbol = enclosingClass;
+ }
+ }
+
m_helpId = buildHelpId(resolvedSymbol, resolvedName);
if (m_toolTip.isEmpty()) {
@@ -349,7 +357,10 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
overview.setShowReturnTypes(true);
overview.setShowFullyQualifiedNamed(true);
- if (lookupSymbol && (lookupSymbol->isDeclaration() || lookupSymbol->isArgument())) {
+ if (symbol == resolvedSymbol && symbol->isClass()) {
+ m_toolTip = m_helpId;
+
+ } else if (lookupSymbol && (lookupSymbol->isDeclaration() || lookupSymbol->isArgument())) {
m_toolTip = overview.prettyType(firstType, buildHelpId(lookupSymbol, lookupSymbol->name()));
} else if (firstType->isClassType() || firstType->isEnumType() ||