aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cpptypehierarchy.h
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2011-07-08 09:56:02 +0200
committerLeandro T. C. Melo <leandro.melo@nokia.com>2011-07-08 14:50:26 +0200
commit23decd9d34dc1e4445e87960784edd8bd782f29d (patch)
treee874fe98d608641eb8c6ca505b0afed2d89bc2a1 /src/plugins/cppeditor/cpptypehierarchy.h
parentb260bf1e733cb812ad14b99244a8aa6996bbd3b7 (diff)
C++ editor: Improve type hierarchy widget
Now the type hierarchy widget will also show the classes derived from the selected one. For consistency the way the base classes are shown was changed too. The diagram below is an example from Creator's code when openining the type hierarchy for BaseTextEditorWidget: Bases +QObject +QWidget +... BaseTextEditorWidget +QPaintDevice +... BaseTextEditorWidget Derived +BaseTextEditorWidget +VCSBaseEditorWidget GitEditor MercurialEditor ... GLSLEditorWidget CppEditorWidget QmlJSTextEditorWidget ... Depending on the project and on the selected class the hierarchy widget might take a bit to be constructed. This should be improved later. Change-Id: Ifbdd1cbbba955a0bdf03297ff0e7620351b12dc5 Reviewed-on: http://codereview.qt.nokia.com/883 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/plugins/cppeditor/cpptypehierarchy.h')
-rw-r--r--src/plugins/cppeditor/cpptypehierarchy.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/cppeditor/cpptypehierarchy.h b/src/plugins/cppeditor/cpptypehierarchy.h
index 2685e1f0c5..4be85f3e73 100644
--- a/src/plugins/cppeditor/cpptypehierarchy.h
+++ b/src/plugins/cppeditor/cpptypehierarchy.h
@@ -33,8 +33,6 @@
#ifndef CPPTYPEHIERARCHY_H
#define CPPTYPEHIERARCHY_H
-#include "cppelementevaluator.h"
-
#include <coreplugin/inavigationwidgetfactory.h>
#include <QtCore/QString>
@@ -45,6 +43,7 @@ QT_BEGIN_NAMESPACE
class QStandardItemModel;
class QStandardItem;
class QModelIndex;
+template <class> class QVector;
QT_END_NAMESPACE
namespace Core {
@@ -60,6 +59,7 @@ namespace CppEditor {
namespace Internal {
class CPPEditorWidget;
+class CppClass;
class CppTypeHierarchyWidget : public QWidget
{
@@ -77,12 +77,8 @@ private slots:
void onItemClicked(const QModelIndex &index);
private:
- enum ItemRole {
- AnnotationRole = Qt::UserRole + 1,
- LinkRole
- };
-
- void buildModel(const CppClass &cppClass, QStandardItem *item);
+ void buildDerivedHierarchy(const CppClass &cppClass, QStandardItem *parent);
+ void buildBaseHierarchy(QVector<CppClass> *s);
CPPEditorWidget *m_cppEditor;
Utils::NavigationTreeView *m_treeView;