forked from qt-creator/qt-creator
ProjectExplorer: Make LayoutBuilder aware of aspects
Change-Id: I3091808309904eeadf5001a68438a9b501dd9fc7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -135,9 +135,13 @@ QLayout *LayoutBuilder::layout() const
|
|||||||
|
|
||||||
LayoutBuilder &LayoutBuilder::addItem(LayoutItem item)
|
LayoutBuilder &LayoutBuilder::addItem(LayoutItem item)
|
||||||
{
|
{
|
||||||
if (item.widget && !item.widget->parent())
|
if (item.aspect) {
|
||||||
item.widget->setParent(m_layout->parentWidget());
|
item.aspect->addToLayout(*this);
|
||||||
m_pendingItems.append(item);
|
} else {
|
||||||
|
if (item.widget && !item.widget->parent())
|
||||||
|
item.widget->setParent(m_layout->parentWidget());
|
||||||
|
m_pendingItems.append(item);
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class Project;
|
class Project;
|
||||||
|
class ProjectConfigurationAspect;
|
||||||
class ProjectConfigurationAspects;
|
class ProjectConfigurationAspects;
|
||||||
class Target;
|
class Target;
|
||||||
|
|
||||||
@@ -53,10 +54,12 @@ public:
|
|||||||
public:
|
public:
|
||||||
LayoutItem(QLayout *layout) : layout(layout) {}
|
LayoutItem(QLayout *layout) : layout(layout) {}
|
||||||
LayoutItem(QWidget *widget) : widget(widget) {}
|
LayoutItem(QWidget *widget) : widget(widget) {}
|
||||||
|
LayoutItem(ProjectConfigurationAspect *aspect) : aspect(aspect) {}
|
||||||
LayoutItem(const QString &text) : text(text) {}
|
LayoutItem(const QString &text) : text(text) {}
|
||||||
|
|
||||||
QLayout *layout = nullptr;
|
QLayout *layout = nullptr;
|
||||||
QWidget *widget = nullptr;
|
QWidget *widget = nullptr;
|
||||||
|
ProjectConfigurationAspect *aspect = nullptr;
|
||||||
QString text;
|
QString text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user