diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index 6ec74f1384b1c7bf1312e35086c299fc226c0b1f..99e87288eaf7c9ddb9aaa1c0cb6ce853e02a2446 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() ||