Utils: Start decoupling LayoutBuilder from Aspects

Makes it easier reusable elsewhere.

Change-Id: I86ff9f40229a33690f854f5fda692bc06d6976ef
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2023-04-24 16:40:01 +02:00
parent 6738616378
commit 72d72251d8
6 changed files with 121 additions and 115 deletions

View File

@@ -421,10 +421,17 @@ QAction *BaseAspect::action()
Adds the visual representation of this aspect to a layout using
a layout builder.
*/
void BaseAspect::addToLayout(Layouting::LayoutBuilder &)
void BaseAspect::addToLayout(LayoutBuilder &)
{
}
void doLayout(const BaseAspect &aspect, LayoutBuilder &builder)
{
const_cast<BaseAspect &>(aspect).addToLayout(builder);
if (builder.layoutType() == LayoutBuilder::FormLayout || builder.layoutType() == LayoutBuilder::VBoxLayout)
builder.finishRow();
}
/*!
Updates this aspect's value from user-initiated changes in the widget.