CppCheck: Move to simpler setLayouter calls

Change-Id: Id0e9f1adfe730f6067ade9472db597e3a12fc2e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-05-31 08:47:33 +02:00
parent 43d5944873
commit ff2ed7d94b
3 changed files with 7 additions and 7 deletions

View File

@@ -108,11 +108,11 @@ CppcheckOptions::CppcheckOptions()
readSettings();
}
std::function<void(QWidget *widget)> CppcheckOptions::layouter()
std::function<Layouting::LayoutItem()> CppcheckOptions::layouter()
{
return [this](QWidget *widget) {
return [this] {
using namespace Layouting;
Form {
return Form {
binary, br,
Tr::tr("Checks:"), Flow {
warning,
@@ -132,7 +132,7 @@ std::function<void(QWidget *widget)> CppcheckOptions::layouter()
addIncludePaths,
guessArguments
}
}.attachTo(widget);
};
};
}

View File

@@ -12,7 +12,7 @@ class CppcheckOptions final : public Core::PagedSettings
public:
CppcheckOptions();
std::function<void(QWidget *widget)> layouter();
std::function<Layouting::LayoutItem()> layouter();
Utils::FilePathAspect binary{this};
Utils::BoolAspect warning{this};

View File

@@ -25,6 +25,7 @@
#include <debugger/analyzer/analyzerconstants.h>
#include <debugger/debuggermainwindow.h>
#include <utils/layoutbuilder.h>
#include <utils/qtcassert.h>
#include <utils/utilsicons.h>
@@ -111,8 +112,7 @@ void CppcheckPluginPrivate::startManualRun()
manualRunTool.updateOptions();
auto optionsWidget = new QWidget;
options.layouter()(optionsWidget);
auto optionsWidget = options.layouter()().emerge();
ManualRunDialog dialog(optionsWidget, project);
if (dialog.exec() == ManualRunDialog::Rejected)