aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2021-04-12 13:43:24 +0200
committerhjk <hjk@qt.io>2021-04-13 09:59:58 +0000
commit38b453609043471115e28320e6686f4256e1fe7b (patch)
tree219cd39ff0403890b756b42a5c307c761f1f2700 /src/plugins/qmlprofiler
parentef108d7a06127836e95780db154bcda24fec7bf2 (diff)
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>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilersettings.cpp9
-rw-r--r--src/plugins/qmlprofiler/qmlprofilersettings.h1
2 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.cpp b/src/plugins/qmlprofiler/qmlprofilersettings.cpp
index 3b5cf312c88..ecc3442fc46 100644
--- a/src/plugins/qmlprofiler/qmlprofilersettings.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilersettings.cpp
@@ -72,8 +72,8 @@ QmlProfilerSettings::QmlProfilerSettings()
flushInterval.setSettingsKey("Analyzer.QmlProfiler.FlushInterval");
flushInterval.setRange(1, 10000000);
flushInterval.setDefaultValue(1000);
- flushInterval.setLabelText(tr("Flush interval (ms):", nullptr));
- flushInterval.setEnabled(false); // Controled by flushEnabled.
+ flushInterval.setLabelText(tr("Flush interval (ms):"));
+ flushInterval.setEnabler(&flushEnabled);
registerAspect(&lastTraceFile);
lastTraceFile.setSettingsKey("Analyzer.QmlProfiler.LastTraceFile");
@@ -88,11 +88,6 @@ QmlProfilerSettings::QmlProfilerSettings()
"for example if multiple QML engines start and stop sequentially during a single run of\n"
"the program."));
- connect(&flushEnabled, &BoolAspect::volatileValueChanged,
- &flushInterval, &BaseAspect::setEnabled);
- connect(&flushEnabled, &BoolAspect::valueChanged,
- &flushInterval, &BaseAspect::setEnabled);
-
// Read stored values
readSettings(Core::ICore::settings());
}
diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.h b/src/plugins/qmlprofiler/qmlprofilersettings.h
index 092debb7822..fa65e73a52c 100644
--- a/src/plugins/qmlprofiler/qmlprofilersettings.h
+++ b/src/plugins/qmlprofiler/qmlprofilersettings.h
@@ -37,6 +37,7 @@ namespace Internal {
class QmlProfilerSettings : public ProjectExplorer::ISettingsAspect
{
Q_OBJECT
+
public:
QmlProfilerSettings();