Qbs: Use a StringAspect for the "Equivalent command line"

Change-Id: I8d8c6039282dcdb870202e6d0d42d017f557b26a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-11-16 10:00:38 +01:00
parent 9e8d88c90b
commit d7b19b929d
2 changed files with 9 additions and 9 deletions

View File

@@ -54,7 +54,6 @@
#include <QJsonArray> #include <QJsonArray>
#include <QJsonObject> #include <QJsonObject>
#include <QLabel> #include <QLabel>
#include <QPlainTextEdit>
#include <QThread> #include <QThread>
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -118,7 +117,6 @@ private:
FancyLineEdit *propertyEdit; FancyLineEdit *propertyEdit;
PathChooser *installDirChooser; PathChooser *installDirChooser;
QCheckBox *defaultInstallDirCheckBox; QCheckBox *defaultInstallDirCheckBox;
QPlainTextEdit *commandLineTextEdit;
}; };
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -176,6 +174,12 @@ QbsBuildStep::QbsBuildStep(BuildStepList *bsl, Utils::Id id) :
m_forceProbes->setLabel(tr("Force probes"), m_forceProbes->setLabel(tr("Force probes"),
BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); 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_maxJobCount, &BaseAspect::changed, this, &QbsBuildStep::updateState);
connect(m_keepGoing, &BaseAspect::changed, this, &QbsBuildStep::updateState); connect(m_keepGoing, &BaseAspect::changed, this, &QbsBuildStep::updateState);
connect(m_showCommandLines, &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 = new PathChooser(this);
installDirChooser->setExpectedKind(PathChooser::Directory); installDirChooser->setExpectedKind(PathChooser::Directory);
commandLineTextEdit = new QPlainTextEdit(this);
commandLineTextEdit->setUndoRedoEnabled(false);
commandLineTextEdit->setReadOnly(true);
commandLineTextEdit->setTextInteractionFlags(Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse);
LayoutBuilder builder(this); LayoutBuilder builder(this);
builder.addRow(m_qbsStep->m_buildVariant); builder.addRow(m_qbsStep->m_buildVariant);
builder.addRow(m_qbsStep->m_maxJobCount); builder.addRow(m_qbsStep->m_maxJobCount);
@@ -573,7 +572,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
builder.addItem(defaultInstallDirCheckBox); builder.addItem(defaultInstallDirCheckBox);
builder.addRow({tr("Installation directory:"), installDirChooser}); 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.")); propertyEdit->setToolTip(tr("Properties to pass to the project."));
defaultInstallDirCheckBox->setText(tr("Use default location")); defaultInstallDirCheckBox->setText(tr("Use default location"));
@@ -628,7 +627,7 @@ void QbsBuildStepConfigWidget::updateState()
addToCommand(qbsBuildConfig->qtQuickCompilerSetting(), addToCommand(qbsBuildConfig->qtQuickCompilerSetting(),
Constants::QBS_CONFIG_QUICK_COMPILER_KEY); Constants::QBS_CONFIG_QUICK_COMPILER_KEY);
commandLineTextEdit->setPlainText(command); m_qbsStep->m_commandLine->setValue(command);
} }

View File

@@ -119,6 +119,7 @@ private:
Utils::BoolAspect *m_install = nullptr; Utils::BoolAspect *m_install = nullptr;
Utils::BoolAspect *m_cleanInstallDir = nullptr; Utils::BoolAspect *m_cleanInstallDir = nullptr;
Utils::BoolAspect *m_forceProbes = nullptr; Utils::BoolAspect *m_forceProbes = nullptr;
Utils::StringAspect *m_commandLine = nullptr;
// Temporary data: // Temporary data:
QStringList m_changedFiles; QStringList m_changedFiles;