forked from qt-creator/qt-creator
Utils: Introduce a BaseAspect::setEnabler(BoolAspect *)
A convenience method to tie the enabled state of an aspect to some other bool aspect, to be used e.g. when settings item availability depends on some check box. Makes it harder to miss one of the three necessary steps. Change-Id: I8c120bb6846aea2a503614f7c73fa57a149cab41 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -74,6 +74,7 @@ BoostTestSettings::BoostTestSettings()
|
||||
seed.setLabelText(tr("Seed:"));
|
||||
seed.setToolTip(tr("A seed of 0 means no randomization. A value of 1 uses the current "
|
||||
"time, any other value is used as random seed generator."));
|
||||
seed.setEnabler(&randomize);
|
||||
|
||||
registerAspect(&randomize);
|
||||
randomize.setSettingsKey("Randomize");
|
||||
@@ -99,8 +100,6 @@ BoostTestSettings::BoostTestSettings()
|
||||
memLeaks.setDefaultValue(true);
|
||||
memLeaks.setLabelText(tr("Detect memory leaks"));
|
||||
memLeaks.setToolTip(tr("Enable memory leak detection."));
|
||||
|
||||
QObject::connect(&randomize, &BoolAspect::volatileValueChanged, &seed, &BaseAspect::setEnabled);
|
||||
}
|
||||
|
||||
BoostTestSettingsPage::BoostTestSettingsPage(BoostTestSettings *settings, Utils::Id settingsId)
|
||||
|
||||
Reference in New Issue
Block a user