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)
|
||||
{
|
||||
if (item.aspect) {
|
||||
item.aspect->addToLayout(*this);
|
||||
} else {
|
||||
if (item.widget && !item.widget->parent())
|
||||
item.widget->setParent(m_layout->parentWidget());
|
||||
m_pendingItems.append(item);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Project;
|
||||
class ProjectConfigurationAspect;
|
||||
class ProjectConfigurationAspects;
|
||||
class Target;
|
||||
|
||||
@@ -53,10 +54,12 @@ public:
|
||||
public:
|
||||
LayoutItem(QLayout *layout) : layout(layout) {}
|
||||
LayoutItem(QWidget *widget) : widget(widget) {}
|
||||
LayoutItem(ProjectConfigurationAspect *aspect) : aspect(aspect) {}
|
||||
LayoutItem(const QString &text) : text(text) {}
|
||||
|
||||
QLayout *layout = nullptr;
|
||||
QWidget *widget = nullptr;
|
||||
ProjectConfigurationAspect *aspect = nullptr;
|
||||
QString text;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user