Fix setEnabler / readSettings order

BaseAspect::setEnabler requires the settings to be read already.
This is because readSettings() does not emit "valueChanged", and so
the connections from the enabler to the target are not triggered.

Change-Id: I0c95e2b516cd03c1dbad653288b44510ec7ea800
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-11-03 15:44:38 +01:00
parent dce08c5b9e
commit 824fee183c
14 changed files with 43 additions and 31 deletions

View File

@@ -49,29 +49,24 @@ CatchFramework::CatchFramework()
abortAfter.setSettingsKey("AbortAfter");
abortAfter.setRange(1, 9999);
abortAfter.setEnabler(&abortAfterChecked);
benchmarkSamples.setSettingsKey("BenchSamples");
benchmarkSamples.setRange(1, 999999);
benchmarkSamples.setDefaultValue(100);
benchmarkSamples.setEnabler(&samplesChecked);
benchmarkResamples.setSettingsKey("BenchResamples");
benchmarkResamples.setRange(1, 9999999);
benchmarkResamples.setDefaultValue(100000);
benchmarkResamples.setToolTip(Tr::tr("Number of resamples for bootstrapping."));
benchmarkResamples.setEnabler(&resamplesChecked);
confidenceInterval.setSettingsKey("BenchConfInt");
confidenceInterval.setRange(0., 1.);
confidenceInterval.setSingleStep(0.05);
confidenceInterval.setDefaultValue(0.95);
confidenceInterval.setEnabler(&confidenceIntervalChecked);
benchmarkWarmupTime.setSettingsKey("BenchWarmup");
benchmarkWarmupTime.setSuffix(Tr::tr(" ms"));
benchmarkWarmupTime.setRange(0, 10000);
benchmarkWarmupTime.setEnabler(&warmupChecked);
abortAfterChecked.setSettingsKey("AbortChecked");
abortAfterChecked.setLabelText(Tr::tr("Abort after"));
@@ -117,6 +112,14 @@ CatchFramework::CatchFramework()
warnOnEmpty.setSettingsKey("WarnEmpty");
warnOnEmpty.setLabelText(Tr::tr("Warn on empty tests"));
warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion."));
readSettings();
benchmarkWarmupTime.setEnabler(&warmupChecked);
confidenceInterval.setEnabler(&confidenceIntervalChecked);
benchmarkResamples.setEnabler(&resamplesChecked);
benchmarkSamples.setEnabler(&samplesChecked);
abortAfter.setEnabler(&abortAfterChecked);
}
ITestParser *CatchFramework::createTestParser()