diff options
author | hjk <hjk@qt.io> | 2018-09-14 14:35:14 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-09-19 13:25:06 +0000 |
commit | d05e906bac963fe48ce3dbceaf65c953ce12e6c0 (patch) | |
tree | 4e589742fb7f575f442f8fb765504911e11f6817 /src/plugins/projectexplorer/buildstep.h | |
parent | 253f7e35afc4e5419c01822f1c61da5ed125ba6d (diff) |
ProjectExplorer: Replace virtual BuildStepConfigWidget::showWidget
... by a bool member.
One reason less for the need of custom derived classes, i.e. one
step forward to a setup where the then-generic config widget can be
created in BuildStepListWidget::init() and filled with aspect-
created subwidget, reducing the need of per-BuildStep boilerplate
similar to what was done in RunConfiguration recently.
Task-number: QTCREATORBUG-19985
Change-Id: I85d26bdb6b35d0d6715782214328a40eef87286e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/buildstep.h')
-rw-r--r-- | src/plugins/projectexplorer/buildstep.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index d6e685735b..ddbb91d5d4 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -174,11 +174,16 @@ public: virtual QString summaryText() const = 0; virtual QString additionalSummaryText() const { return QString(); } virtual QString displayName() const = 0; - virtual bool showWidget() const { return true; } + + bool showWidget() const { return m_showWidget; } + void setShowWidget(bool showWidget) { m_showWidget = showWidget; } signals: void updateSummary(); void updateAdditionalSummary(); + +private: + bool m_showWidget = true; }; class PROJECTEXPLORER_EXPORT SimpleBuildStepConfigWidget : public BuildStepConfigWidget @@ -189,11 +194,11 @@ public: { connect(m_step, &ProjectConfiguration::displayNameChanged, this, &BuildStepConfigWidget::updateSummary); + setShowWidget(false); } QString summaryText() const override { return QLatin1String("<b>") + displayName() + QLatin1String("</b>"); } QString displayName() const override { return m_step->displayName(); } - bool showWidget() const override { return false; } BuildStep *step() const { return m_step; } private: |