forked from qt-creator/qt-creator
Use LayoutBuilder V2
This puts the implementation introduced in acf1ecb47f into use, after
significant simplifications in the class hierarchy. CRTP is not used
anymore, and the new tag based dispatch is also used for Layout::addItem,
effectively reducing the number of different code paths.
The Lua based settings access is disabled for now.
Change-Id: Idb6d1a25675378757c5267bdb630bcd4c1f52d34
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -320,10 +320,10 @@ public:
|
||||
m_aspects->toMap(map);
|
||||
}
|
||||
|
||||
std::optional<Layouting::LayoutItem> settingsLayout()
|
||||
Layouting::LayoutModifier settingsLayout()
|
||||
{
|
||||
if (m_aspects && m_aspects->layouter())
|
||||
return m_aspects->layouter()();
|
||||
if (m_aspects)
|
||||
return [this](Layouting::Layout *iface) { m_aspects->addToLayout(*iface); };
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -483,8 +483,7 @@ QWidget *LuaClientSettings::createSettingsWidget(QWidget *parent) const
|
||||
using namespace Layouting;
|
||||
|
||||
if (auto w = m_wrapper.lock())
|
||||
if (std::optional<LayoutItem> layout = w->settingsLayout())
|
||||
return new BaseSettingsWidget(this, parent, layout->subItems);
|
||||
return new BaseSettingsWidget(this, parent, w->settingsLayout());
|
||||
|
||||
return new BaseSettingsWidget(this, parent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user