Utils: Add a PushButton object to LayoutBuilder

Change-Id: I1ed0fd9a940fcaa5361a7d619a5d316f646332b1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-08-01 18:18:02 +02:00
parent 1a2732ee9c
commit fee3a1dc78
3 changed files with 63 additions and 6 deletions

View File

@@ -157,10 +157,6 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
Tr::tr("Timeout used when executing test cases. This will apply "
"for each test case on its own, not the whole project."));
auto resetChoicesButton = new QPushButton(Tr::tr("Reset Cached Choices"));
resetChoicesButton->setToolTip(
Tr::tr("Clear all cached choices of run configurations for tests where the executable could not be deduced."));
m_frameworkTreeWidget = new QTreeWidget;
m_frameworkTreeWidget->setRootIsDecorated(false);
m_frameworkTreeWidget->setHeaderHidden(false);
@@ -181,6 +177,13 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
using namespace Utils::Layouting;
PushButton resetChoicesButton {
text(Tr::tr("Reset Cached Choices")),
tooltip(Tr::tr("Clear all cached choices of run configurations for "
"tests where the executable could not be deduced.")),
onClicked([] { AutotestPlugin::clearChoiceCache(); }, this)
};
Group generalGroup {
title(Tr::tr("General")),
Column {
@@ -218,8 +221,6 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
connect(m_frameworkTreeWidget, &QTreeWidget::itemChanged,
this, &TestSettingsWidget::onFrameworkItemChanged);
connect(resetChoicesButton, &QPushButton::clicked,
this, [] { AutotestPlugin::clearChoiceCache(); });
connect(m_openResultsOnFinishCB, &QCheckBox::toggled,
m_openResultsOnFailCB, &QCheckBox::setEnabled);
connect(m_limitResultDescriptionCb, &QCheckBox::toggled,