forked from qt-creator/qt-creator
Add search functionality to type hierarchy pane
Change-Id: I76262610cdd3781b5d665e7de501cc8a7ba4012b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -34,14 +34,16 @@
|
||||
#include "cppelementevaluator.h"
|
||||
#include "cppeditorplugin.h"
|
||||
|
||||
#include <coreplugin/find/treeviewfind.h>
|
||||
#include <utils/navigationtreeview.h>
|
||||
#include <utils/annotateditemdelegate.h>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QLatin1String>
|
||||
#include <QModelIndex>
|
||||
#include <QVBoxLayout>
|
||||
#include <QStackedLayout>
|
||||
#include <QStandardItemModel>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
using namespace CppEditor;
|
||||
using namespace Internal;
|
||||
@@ -146,14 +148,19 @@ CppTypeHierarchyWidget::CppTypeHierarchyWidget() :
|
||||
m_noTypeHierarchyAvailableLabel->setAutoFillBackground(true);
|
||||
m_noTypeHierarchyAvailableLabel->setBackgroundRole(QPalette::Base);
|
||||
|
||||
m_hierarchyWidget = new QWidget(this);
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(m_inspectedClass);
|
||||
layout->addWidget(m_treeView);
|
||||
layout->addWidget(m_noTypeHierarchyAvailableLabel);
|
||||
layout->addWidget(Core::TreeViewFind::createSearchableWrapper(m_treeView));
|
||||
m_hierarchyWidget->setLayout(layout);
|
||||
|
||||
setLayout(layout);
|
||||
m_stackLayout = new QStackedLayout;
|
||||
m_stackLayout->addWidget(m_hierarchyWidget);
|
||||
m_stackLayout->addWidget(m_noTypeHierarchyAvailableLabel);
|
||||
m_stackLayout->setCurrentWidget(m_noTypeHierarchyAvailableLabel);
|
||||
setLayout(m_stackLayout);
|
||||
|
||||
connect(CppEditorPlugin::instance(), SIGNAL(typeHierarchyRequested()), SLOT(perform()));
|
||||
}
|
||||
@@ -211,16 +218,12 @@ void CppTypeHierarchyWidget::buildHierarchy(const CppClass &cppClass, QStandardI
|
||||
|
||||
void CppTypeHierarchyWidget::showNoTypeHierarchyLabel()
|
||||
{
|
||||
m_inspectedClass->hide();
|
||||
m_treeView->hide();
|
||||
m_noTypeHierarchyAvailableLabel->show();
|
||||
m_stackLayout->setCurrentWidget(m_noTypeHierarchyAvailableLabel);
|
||||
}
|
||||
|
||||
void CppTypeHierarchyWidget::showTypeHierarchy()
|
||||
{
|
||||
m_inspectedClass->show();
|
||||
m_treeView->show();
|
||||
m_noTypeHierarchyAvailableLabel->hide();
|
||||
m_stackLayout->setCurrentWidget(m_hierarchyWidget);
|
||||
}
|
||||
|
||||
void CppTypeHierarchyWidget::clearTypeHierarchy()
|
||||
|
@@ -37,10 +37,11 @@
|
||||
#include <QStackedWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QStandardItemModel;
|
||||
class QStandardItem;
|
||||
class QModelIndex;
|
||||
class QLabel;
|
||||
class QModelIndex;
|
||||
class QStackedLayout;
|
||||
class QStandardItem;
|
||||
class QStandardItemModel;
|
||||
template <class> class QVector;
|
||||
template <class> class QList;
|
||||
QT_END_NAMESPACE
|
||||
@@ -82,6 +83,8 @@ private:
|
||||
|
||||
CPPEditorWidget *m_cppEditor;
|
||||
Utils::NavigationTreeView *m_treeView;
|
||||
QWidget *m_hierarchyWidget;
|
||||
QStackedLayout *m_stackLayout;
|
||||
QStandardItemModel *m_model;
|
||||
Utils::AnnotatedItemDelegate *m_delegate;
|
||||
CppClassLabel *m_inspectedClass;
|
||||
|
Reference in New Issue
Block a user