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:
hjk
2023-06-21 18:13:56 +02:00
parent 03aeee71f4
commit 091b853068
5 changed files with 85 additions and 74 deletions

View File

@@ -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;