diff options
author | hjk <hjk@qt.io> | 2020-11-16 10:00:38 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-11-16 12:12:59 +0000 |
commit | d7b19b929d7680629b3ca7ea7479630657e5c6ad (patch) | |
tree | 14bb6cf20aefe630e92aba08a62413421aa4c154 /src/plugins/qbsprojectmanager/qbsbuildstep.cpp | |
parent | 9e8d88c90b4194e0bd61d770f602feaa726cb3a5 (diff) |
Qbs: Use a StringAspect for the "Equivalent command line"
Change-Id: I8d8c6039282dcdb870202e6d0d42d017f557b26a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qbsprojectmanager/qbsbuildstep.cpp')
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index e12f477167..00ccdf8459 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -54,7 +54,6 @@ #include <QJsonArray> #include <QJsonObject> #include <QLabel> -#include <QPlainTextEdit> #include <QThread> // -------------------------------------------------------------------- @@ -118,7 +117,6 @@ private: FancyLineEdit *propertyEdit; PathChooser *installDirChooser; QCheckBox *defaultInstallDirCheckBox; - QPlainTextEdit *commandLineTextEdit; }; // -------------------------------------------------------------------- @@ -176,6 +174,12 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Utils::Id id) : m_forceProbes->setLabel(tr("Force probes"), BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); + m_commandLine = addAspect<StringAspect>(); + m_commandLine->setDisplayStyle(StringAspect::TextEditDisplay); + m_commandLine->setLabelText(tr("Equivalent command line:")); + m_commandLine->setUndoRedoEnabled(false); + m_commandLine->setReadOnly(true); + connect(m_maxJobCount, &BaseAspect::changed, this, &QbsBuildStep::updateState); connect(m_keepGoing, &BaseAspect::changed, this, &QbsBuildStep::updateState); connect(m_showCommandLines, &BaseAspect::changed, this, &QbsBuildStep::updateState); @@ -552,11 +556,6 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : installDirChooser = new PathChooser(this); installDirChooser->setExpectedKind(PathChooser::Directory); - commandLineTextEdit = new QPlainTextEdit(this); - commandLineTextEdit->setUndoRedoEnabled(false); - commandLineTextEdit->setReadOnly(true); - commandLineTextEdit->setTextInteractionFlags(Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); - LayoutBuilder builder(this); builder.addRow(m_qbsStep->m_buildVariant); builder.addRow(m_qbsStep->m_maxJobCount); @@ -573,7 +572,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : builder.addItem(defaultInstallDirCheckBox); builder.addRow({tr("Installation directory:"), installDirChooser}); - builder.addRow({tr("Equivalent command line:"), commandLineTextEdit}); + builder.addRow(m_qbsStep->m_commandLine); propertyEdit->setToolTip(tr("Properties to pass to the project.")); defaultInstallDirCheckBox->setText(tr("Use default location")); @@ -628,7 +627,7 @@ void QbsBuildStepConfigWidget::updateState() addToCommand(qbsBuildConfig->qtQuickCompilerSetting(), Constants::QBS_CONFIG_QUICK_COMPILER_KEY); - commandLineTextEdit->setPlainText(command); + m_qbsStep->m_commandLine->setValue(command); } |