AutoTest: Use Utils::InfoLabel in TestSettingsPage

Task-number: QTCREATORBUG-23346
Change-Id: Iacf60422707953eeff40b67fa752627f688b8a17
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2019-12-13 22:47:32 +01:00
parent cd86aa05d6
commit cf7c78d2f9
2 changed files with 10 additions and 22 deletions

View File

@@ -43,9 +43,9 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
{
m_ui.setupUi(this);
m_ui.frameworksWarnIcon->setVisible(false);
m_ui.frameworksWarnIcon->setPixmap(Utils::Icons::WARNING.pixmap());
m_ui.frameworksWarn->setVisible(false);
m_ui.frameworksWarn->setElideMode(Qt::ElideNone);
m_ui.frameworksWarn->setType(Utils::InfoLabel::Warning);
m_ui.frameworksWarn->setText(tr("No active test frameworks."));
m_ui.frameworksWarn->setToolTip(tr("You will not be able to use the AutoTest plugin without "
"having at least one active test framework."));
@@ -133,13 +133,11 @@ void TestSettingsWidget::onFrameworkItemChanged()
for (int row = 0, count = model->rowCount(); row < count; ++row) {
if (model->index(row, 0).data(Qt::CheckStateRole) == Qt::Checked) {
m_ui.frameworksWarn->setVisible(false);
m_ui.frameworksWarnIcon->setVisible(false);
return;
}
}
}
m_ui.frameworksWarn->setVisible(true);
m_ui.frameworksWarnIcon->setVisible(true);
}
TestSettingsPage::TestSettingsPage(const QSharedPointer<TestSettings> &settings)

View File

@@ -343,24 +343,7 @@ Warning: this is an experimental feature and might lead to failing to execute th
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="0,0">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="frameworksWarnIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="frameworksWarn"/>
</item>
</layout>
<widget class="Utils::InfoLabel" name="frameworksWarn"/>
</item>
</layout>
</widget>
@@ -397,6 +380,13 @@ Warning: this is an experimental feature and might lead to failing to execute th
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::InfoLabel</class>
<extends>QLabel</extends>
<header location="global">utils/infolabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>