ProjectExplorer: Optionally show run environment in app output pane

Fixes: QTCREATORBUG-28427
Change-Id: I1022a377d3728ad5e91fa62514082110b86db9f4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Christian Kandeler
2023-04-24 17:25:13 +02:00
parent 8903e7f387
commit 02d86516c7
8 changed files with 46 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
#include <utils/environment.h>
#include <utils/qtcassert.h>
#include <QCheckBox>
#include <QComboBox>
#include <QHBoxLayout>
#include <QLabel>
@@ -63,6 +64,14 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect)
m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
topLayout->addWidget(m_environmentWidget);
if (m_aspect->isPrintOnRunAllowed()) {
const auto printOnRunCheckBox = new QCheckBox(Tr::tr("Show in output pane when running"));
printOnRunCheckBox->setChecked(m_aspect->isPrintOnRunEnabled());
connect(printOnRunCheckBox, &QCheckBox::toggled,
m_aspect, &EnvironmentAspect::setPrintOnRun);
topLayout->addWidget(printOnRunCheckBox);
}
connect(m_environmentWidget, &EnvironmentWidget::userChangesChanged,
this, &EnvironmentAspectWidget::userChangesEdited);