diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-11-25 13:31:27 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-11-25 13:25:02 +0000 |
commit | 6c66af5c233dafe40d4c4e53c6ef506aaec704cd (patch) | |
tree | 0bf28994c0dd9d5f0875dfe293f7d9a4f19041f1 /src/plugins/qtsupport/qtbuildaspects.cpp | |
parent | 9811f95aa7a4384d5fe21233b9019dd13a01c979 (diff) |
ProjectExplorer: Add a base class for build aspects
... and make use of it in the QmlDebuggingAspect.
A build setting is conceptually not a boolean, but a tri-state, as we
need to support force-switching a feature on and off as well as
specifying that it is to be left at its default value.
Change-Id: I15552614c5cf4f5187c026909d233c13e3487e81
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/qtbuildaspects.cpp')
-rw-r--r-- | src/plugins/qtsupport/qtbuildaspects.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/qtsupport/qtbuildaspects.cpp b/src/plugins/qtsupport/qtbuildaspects.cpp index 5c8a400499..093905c8c7 100644 --- a/src/plugins/qtsupport/qtbuildaspects.cpp +++ b/src/plugins/qtsupport/qtbuildaspects.cpp @@ -38,15 +38,15 @@ using namespace ProjectExplorer; namespace QtSupport { -QmlDebuggingAspect::QmlDebuggingAspect() : BaseBoolAspect("EnableQmlDebugging") +QmlDebuggingAspect::QmlDebuggingAspect() { - setDefaultValue(true); - setLabel(tr("Enable QML debugging and profiling")); + setSettingsKey("EnableQmlDebugging"); + setDisplayName(tr("QML debugging and profiling")); } void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder) { - BaseBoolAspect::addToLayout(builder); + BaseSelectionAspect::addToLayout(builder); const auto warningIconLabel = new QLabel; warningIconLabel->setAlignment(Qt::AlignTop); warningIconLabel->setPixmap(Utils::Icons::WARNING.pixmap()); @@ -57,13 +57,13 @@ void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder) QString warningText; const bool supported = m_kit && BaseQtVersion::isQmlDebuggingSupported(m_kit, &warningText); if (!supported) { - setValue(false); - } else if (value()) { + setSetting(Value::Default); + } else if (setting() == Value::Enabled) { warningText = tr("Might make your application vulnerable.<br/>" "Only use in a safe environment."); } warningTextLabel->setText(warningText); - checkBox()->setVisible(supported); + setVisibleDynamic(supported); warningIconLabel->setVisible(supported && !warningText.isEmpty()); warningTextLabel->setVisible(supported); }; |