From d7b19b929d7680629b3ca7ea7479630657e5c6ad Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 16 Nov 2020 10:00:38 +0100 Subject: [PATCH] Qbs: Use a StringAspect for the "Equivalent command line" Change-Id: I8d8c6039282dcdb870202e6d0d42d017f557b26a Reviewed-by: Christian Kandeler --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 17 ++++++++--------- src/plugins/qbsprojectmanager/qbsbuildstep.h | 1 + 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index e12f477167e..00ccdf8459a 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -54,7 +54,6 @@ #include #include #include -#include #include // -------------------------------------------------------------------- @@ -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(); + 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); } diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 86171e5729e..ea9109169d0 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -119,6 +119,7 @@ private: Utils::BoolAspect *m_install = nullptr; Utils::BoolAspect *m_cleanInstallDir = nullptr; Utils::BoolAspect *m_forceProbes = nullptr; + Utils::StringAspect *m_commandLine = nullptr; // Temporary data: QStringList m_changedFiles;