Commit ebabc837 authored by hjk's avatar hjk
Browse files

CppEditor: Remove unneeded intermediate CppTypeHierarchyStackedWidget



Change-Id: I2cd3a13aca4012dadc73d909ff73135eb487cd82
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent 540ac8ce
......@@ -241,19 +241,6 @@ void CppTypeHierarchyWidget::onItemClicked(const QModelIndex &index)
Constants::CPPEDITOR_ID);
}
// CppTypeHierarchyStackedWidget
CppTypeHierarchyStackedWidget::CppTypeHierarchyStackedWidget(QWidget *parent) :
QStackedWidget(parent),
m_typeHiearchyWidgetInstance(new CppTypeHierarchyWidget)
{
addWidget(m_typeHiearchyWidgetInstance);
}
CppTypeHierarchyStackedWidget::~CppTypeHierarchyStackedWidget()
{
delete m_typeHiearchyWidgetInstance;
}
// CppTypeHierarchyFactory
CppTypeHierarchyFactory::CppTypeHierarchyFactory()
{
......@@ -264,8 +251,8 @@ CppTypeHierarchyFactory::CppTypeHierarchyFactory()
Core::NavigationView CppTypeHierarchyFactory::createWidget()
{
CppTypeHierarchyStackedWidget *w = new CppTypeHierarchyStackedWidget;
static_cast<CppTypeHierarchyWidget *>(w->currentWidget())->perform();
auto w = new CppTypeHierarchyWidget;
w->perform();
return Core::NavigationView(w);
}
......
......@@ -91,22 +91,10 @@ private:
QLabel *m_noTypeHierarchyAvailableLabel;
};
// @todo: Pretty much the same design as the OutlineWidgetStack. Maybe we can generalize the
// outline factory so that it works for different widgets that support the same editor.
class CppTypeHierarchyStackedWidget : public QStackedWidget
{
Q_OBJECT
public:
CppTypeHierarchyStackedWidget(QWidget *parent = 0);
virtual ~CppTypeHierarchyStackedWidget();
private:
CppTypeHierarchyWidget *m_typeHiearchyWidgetInstance;
};
class CppTypeHierarchyFactory : public Core::INavigationWidgetFactory
{
Q_OBJECT
public:
CppTypeHierarchyFactory();
......
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