Commit 28be7bc4 authored by Leandro Melo's avatar Leandro Melo
Browse files

C++ tooltip: Make sure to get the correct list of base classes.

parent 62e33d0e
......@@ -60,6 +60,8 @@
#include <QtGui/QToolTip>
#include <QtGui/QTextCursor>
#include <algorithm>
using namespace CppEditor::Internal;
using namespace CPlusPlus;
using namespace Core;
......@@ -95,11 +97,14 @@ namespace {
const QList<Symbol *> &symbols = baseClass->symbols();
foreach (Symbol *baseSymbol, symbols) {
if (baseSymbol->isClass()) {
hierarchy->back().append(overview.prettyName(
LookupContext::fullyQualifiedName(baseSymbol)));
buildClassHierarchyHelper(baseSymbol, context, overview, hierarchy);
hierarchy->append(hierarchy->back());
hierarchy->back().removeLast();
const QString &qualifiedName = overview.prettyName(
LookupContext::fullyQualifiedName(baseSymbol));
if (!qualifiedName.isEmpty()) {
hierarchy->back().append(qualifiedName);
buildClassHierarchyHelper(baseSymbol, context, overview, hierarchy);
hierarchy->append(hierarchy->back());
hierarchy->back().removeLast();
}
}
}
}
......@@ -476,6 +481,10 @@ void CppHoverHandler::generateDiagramTooltip(const bool extendTooltips)
qSort(m_classHierarchy.begin(), m_classHierarchy.end(), ClassHierarchyComp());
// Remove duplicates (in case there are any).
m_classHierarchy.erase(std::unique(m_classHierarchy.begin(), m_classHierarchy.end()),
m_classHierarchy.end());
QStringList directBaseClasses;
foreach (const QStringList &hierarchy, m_classHierarchy) {
if (hierarchy.size() > 1)
......
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