Beautifier: Fix setting customized style (again)

Amends 4de56e2683

BoolAspect only changes its value if the check box is "clicked", so when
the customized style check box is clicked, the BoolAspect for
usePredefinedStyle does not change its value even though the check box
does.

Fixes: QTCREATORBUG-28525
Change-Id: Ie14c7669c7b41ef1a27dcb5ee69f610b773105fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2023-07-31 09:07:13 +02:00
parent c505188580
commit 305bdba221

View File

@@ -59,9 +59,6 @@ ClangFormatSettings::ClangFormatSettings()
fallbackStyle.addOption("WebKit");
fallbackStyle.setDefaultValue("Default");
predefinedStyle.setSettingsKey("predefinedStyle");
predefinedStyle.setDefaultValue("LLVM");
customStyle.setSettingsKey("customStyle");
documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME)
@@ -254,7 +251,8 @@ public:
connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled);
connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled);
setOnApply([settings, configurations] {
setOnApply([settings, configurations, customizedStyleButton] {
settings->usePredefinedStyle.setValue(!customizedStyleButton->isChecked());
settings->customStyle.setValue(configurations->currentConfiguration());
settings->save();
});