diff --git a/src/plugins/autotest/boost/boosttestsettings.cpp b/src/plugins/autotest/boost/boosttestsettings.cpp index 840647572a4..958f756bfe0 100644 --- a/src/plugins/autotest/boost/boosttestsettings.cpp +++ b/src/plugins/autotest/boost/boosttestsettings.cpp @@ -22,15 +22,15 @@ BoostTestSettings::BoostTestSettings(Id settingsId) setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettingsGroups("Autotest", "BoostTest"); - setLayouter([this](QWidget *widget) { - Row { Form { + setLayouter([this] { + return Row { Form { logLevel, br, reportLevel, br, randomize, Row { seed }, br, systemErrors, br, fpExceptions, br, memLeaks, - }, st}.attachTo(widget); + }, st}; }); registerAspect(&logLevel); diff --git a/src/plugins/autotest/catch/catchtestsettings.cpp b/src/plugins/autotest/catch/catchtestsettings.cpp index 07dac310ebe..4859efdeaae 100644 --- a/src/plugins/autotest/catch/catchtestsettings.cpp +++ b/src/plugins/autotest/catch/catchtestsettings.cpp @@ -6,8 +6,6 @@ #include "../autotestconstants.h" #include "../autotesttr.h" -#include - #include using namespace Layouting; @@ -22,8 +20,8 @@ CatchTestSettings::CatchTestSettings(Id settingsId) setDisplayName(Tr::tr("Catch Test")); setSettingsGroups("Autotest", "Catch2"); - setLayouter([this](QWidget *widget) { - Row { Form { + setLayouter([this] { + return Row { Form { showSuccess, br, breakOnFailure, br, noThrow, br, @@ -34,7 +32,7 @@ CatchTestSettings::CatchTestSettings(Id settingsId) confidenceIntervalChecked, confidenceInterval, br, warmupChecked, benchmarkWarmupTime, br, noAnalysis - }, st }.attachTo(widget); + }, st }; }); registerAspect(&abortAfter); diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestsettings.cpp index d7302d6bd57..f6fe44135ac 100644 --- a/src/plugins/autotest/gtest/gtestsettings.cpp +++ b/src/plugins/autotest/gtest/gtestsettings.cpp @@ -23,15 +23,15 @@ GTestSettings::GTestSettings(Id settingsId) setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); - setLayouter([this](QWidget *widget) { - Row { Form { + setLayouter([this] { + return Row { Form { runDisabled, br, breakOnFailure, br, repeat, iterations, br, shuffle, seed, br, groupMode, br, gtestFilter, br - }, st }.attachTo(widget); + }, st }; }); registerAspect(&iterations); diff --git a/src/plugins/autotest/qtest/qttestsettings.cpp b/src/plugins/autotest/qtest/qttestsettings.cpp index 07fac99d986..4db11ebdb17 100644 --- a/src/plugins/autotest/qtest/qttestsettings.cpp +++ b/src/plugins/autotest/qtest/qttestsettings.cpp @@ -22,8 +22,8 @@ QtTestSettings::QtTestSettings(Id settingsId) setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); - setLayouter([this](QWidget *widget) { - Row { Form { + setLayouter([this] { + return Row { Form { noCrashHandler, br, useXMLOutput, br, verboseBench, br, @@ -34,7 +34,7 @@ QtTestSettings::QtTestSettings(Id settingsId) Column { metrics } }, br, quickCheckForDerivedTests, br - }, st }.attachTo(widget); + }, st }; }); registerAspect(&metrics); diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index bb9b80a9133..d7646749c68 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -208,6 +208,15 @@ void IOptionsPage::setLayouter(const std::function &layouter) }; } +void IOptionsPage::setLayouter(const std::function &layouter) +{ + m_widgetCreator = [layouter] { + auto widget = new IOptionsPageWidget; + layouter().attachTo(widget); + return widget; + }; +} + /*! \fn void Core::IOptionsPage::setId(Utils::Id id) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 96d9b6824af..a38bf863c36 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -75,6 +75,7 @@ protected: void setCategoryIconPath(const Utils::FilePath &categoryIconPath); void setSettings(Utils::AspectContainer *settings); void setLayouter(const std::function &layouter); + void setLayouter(const std::function &layouter); // Used in FontSettingsPage. FIXME? QPointer m_widget; // Used in conjunction with m_widgetCreator diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index f3c6daad53e..dd12a68e73d 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -33,7 +33,7 @@ FileShareProtocolSettings::FileShareProtocolSettings() displayCount.setSuffix(' ' + Tr::tr("entries")); displayCount.setLabelText(Tr::tr("&Display:")); - setLayouter([this](QWidget *widget) { + setLayouter([this] { using namespace Layouting; auto label = new QLabel(Tr::tr( @@ -41,14 +41,14 @@ FileShareProtocolSettings::FileShareProtocolSettings() "simple files on a shared network drive. Files are never deleted.")); label->setWordWrap(true); - Column { + return Column { Form { label, br, path, br, displayCount }, st - }.attachTo(widget); + }; }); readSettings();