ClangTools: Use Utils::InfoLabel in DiagnosticConfigsWidget

Task-number: QTCREATORBUG-23346
Change-Id: I5eeb40c50b55c4779ee3e4aa144274604f259f32
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Alessandro Portale
2019-12-14 16:20:50 +01:00
parent 8a1daa15fa
commit 574174840e
3 changed files with 34 additions and 70 deletions

View File

@@ -127,42 +127,15 @@
<widget class="QWidget" name="invalidExecutablePage"> <widget class="QWidget" name="invalidExecutablePage">
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="Utils::InfoLabel" name="invalidExecutableLabel">
<item> <property name="text">
<widget class="QLabel" name="invalidExecutableIcon"> <string>Could not query the supported checks from the clazy-standalone executable.
<property name="text">
<string>Icon</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="invalidExecutableText">
<property name="text">
<string>Could not query the supported checks from the clazy-standalone executable.
Set a valid executable first.</string> Set a valid executable first.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
</widget> </widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
@@ -183,6 +156,13 @@ Set a valid executable first.</string>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>Utils::InfoLabel</class>
<extends>QLabel</extends>
<header location="global">utils/infolabel.h</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -35,7 +35,6 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/utilsicons.h>
#include <QDesktopServices> #include <QDesktopServices>
#include <QDialogButtonBox> #include <QDialogButtonBox>
@@ -709,7 +708,8 @@ DiagnosticConfigsWidget::DiagnosticConfigsWidget(const ClangDiagnosticConfigs &c
m_clazyChecks = std::make_unique<Ui::ClazyChecks>(); m_clazyChecks = std::make_unique<Ui::ClazyChecks>();
m_clazyChecksWidget = new QWidget(); m_clazyChecksWidget = new QWidget();
m_clazyChecks->setupUi(m_clazyChecksWidget); m_clazyChecks->setupUi(m_clazyChecksWidget);
m_clazyChecks->invalidExecutableIcon->setPixmap(Utils::Icons::WARNING.pixmap()); m_clazyChecks->invalidExecutableLabel->setType(Utils::InfoLabel::Warning);
m_clazyChecks->invalidExecutableLabel->setElideMode(Qt::ElideNone);
m_clazySortFilterProxyModel = new ClazyChecksSortFilterModel(this); m_clazySortFilterProxyModel = new ClazyChecksSortFilterModel(this);
m_clazySortFilterProxyModel->setSourceModel(m_clazyTreeModel.get()); m_clazySortFilterProxyModel->setSourceModel(m_clazyTreeModel.get());
setupTreeView(m_clazyChecks->checksView, m_clazySortFilterProxyModel, 2); setupTreeView(m_clazyChecks->checksView, m_clazySortFilterProxyModel, 2);
@@ -752,7 +752,8 @@ DiagnosticConfigsWidget::DiagnosticConfigsWidget(const ClangDiagnosticConfigs &c
m_tidyChecks = std::make_unique<Ui::TidyChecks>(); m_tidyChecks = std::make_unique<Ui::TidyChecks>();
m_tidyChecksWidget = new QWidget(); m_tidyChecksWidget = new QWidget();
m_tidyChecks->setupUi(m_tidyChecksWidget); m_tidyChecks->setupUi(m_tidyChecksWidget);
m_tidyChecks->invalidExecutableIcon->setPixmap(Utils::Icons::WARNING.pixmap()); m_tidyChecks->invalidExecutableLabel->setType(Utils::InfoLabel::Warning);
m_tidyChecks->invalidExecutableLabel->setElideMode(Qt::ElideNone);
setupTreeView(m_tidyChecks->checksPrefixesTree, m_tidyTreeModel.get()); setupTreeView(m_tidyChecks->checksPrefixesTree, m_tidyTreeModel.get());
connect(m_tidyChecks->checksPrefixesTree, connect(m_tidyChecks->checksPrefixesTree,

View File

@@ -129,39 +129,15 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <widget class="Utils::InfoLabel" name="invalidExecutableLabel">
<item> <property name="text">
<widget class="QLabel" name="invalidExecutableIcon"> <string>Could not query the supported checks from the clang-tidy executable.
<property name="text">
<string>Icon</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="invalidExecutableLabel">
<property name="text">
<string>Could not query the supported checks from the clang-tidy executable.
Set a valid executable first.</string> Set a valid executable first.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
</widget> </widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
@@ -182,6 +158,13 @@ Set a valid executable first.</string>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>Utils::InfoLabel</class>
<extends>QLabel</extends>
<header location="global">utils/infolabel.h</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>