forked from qt-creator/qt-creator
Utils/Core: Make an aspect container layoutable
Most aspect containers end in a widget at some time. Let them declare how. The optionspages don't need a layouter anymore when using their settings' one. There was only one case where there was none, fix that one (perforce). Change-Id: Ibd39bcd4af98c3eae1daafa59f6c1d6e7a571989 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -2430,6 +2430,7 @@ public:
|
||||
QList<BaseAspect *> m_ownedItems; // Owned only.
|
||||
bool m_autoApply = true;
|
||||
QStringList m_settingsGroup;
|
||||
std::function<Layouting::LayoutItem ()> m_layouter;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
@@ -2483,6 +2484,16 @@ AspectContainer::const_iterator AspectContainer::end() const
|
||||
return d->m_items.cend();
|
||||
}
|
||||
|
||||
void AspectContainer::setLayouter(const std::function<Layouting::LayoutItem ()> &layouter)
|
||||
{
|
||||
d->m_layouter = layouter;
|
||||
}
|
||||
|
||||
std::function<LayoutItem ()> AspectContainer::layouter() const
|
||||
{
|
||||
return d->m_layouter;
|
||||
}
|
||||
|
||||
const QList<BaseAspect *> &AspectContainer::aspects() const
|
||||
{
|
||||
return d->m_items;
|
||||
|
||||
Reference in New Issue
Block a user