forked from qt-creator/qt-creator
Android: Use Utils::InfoLabel in AndroidSettingsWidget
Task-number: QTCREATORBUG-23346 Change-Id: I60ec7a27805fdea97ed572ad4d00150d935d4433 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/elidinglabel.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/infolabel.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/runextensions.h>
|
#include <utils/runextensions.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
@@ -88,8 +88,7 @@ class SummaryWidget : public QWidget
|
|||||||
{
|
{
|
||||||
class RowData {
|
class RowData {
|
||||||
public:
|
public:
|
||||||
QLabel *m_iconLabel = nullptr;
|
Utils::InfoLabel *m_infoLabel = nullptr;
|
||||||
Utils::ElidingLabel *m_textLabel = nullptr;
|
|
||||||
bool m_valid = false;
|
bool m_valid = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -102,20 +101,14 @@ public:
|
|||||||
m_detailsWidget(detailsWidget)
|
m_detailsWidget(detailsWidget)
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_detailsWidget);
|
QTC_CHECK(m_detailsWidget);
|
||||||
auto layout = new QGridLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
layout->setContentsMargins(12, 12, 12, 12);
|
layout->setContentsMargins(12, 12, 12, 12);
|
||||||
int row = 0;
|
|
||||||
for (auto itr = validationPoints.cbegin(); itr != validationPoints.cend(); ++itr) {
|
for (auto itr = validationPoints.cbegin(); itr != validationPoints.cend(); ++itr) {
|
||||||
RowData data;
|
RowData data;
|
||||||
data.m_iconLabel = new QLabel(this);
|
data.m_infoLabel = new Utils::InfoLabel(itr.value());
|
||||||
layout->addWidget(data.m_iconLabel, row, 0, 1, 1);
|
layout->addWidget(data.m_infoLabel);
|
||||||
data.m_textLabel = new Utils::ElidingLabel(itr.value(), this);
|
|
||||||
data.m_textLabel->setElideMode(Qt::ElideRight);
|
|
||||||
data.m_textLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
||||||
layout->addWidget(data.m_textLabel, row, 1, 1, 1);
|
|
||||||
m_validationData[itr.key()] = data;
|
m_validationData[itr.key()] = data;
|
||||||
setPointValid(itr.key(), true);
|
setPointValid(itr.key(), true);
|
||||||
++row;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,8 +118,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
RowData& data = m_validationData[key];
|
RowData& data = m_validationData[key];
|
||||||
data.m_valid = valid;
|
data.m_valid = valid;
|
||||||
data.m_iconLabel->setPixmap(data.m_valid ? Utils::Icons::OK.pixmap() :
|
data.m_infoLabel->setType(valid ? Utils::InfoLabel::Ok : Utils::InfoLabel::NotOk);
|
||||||
Utils::Icons::BROKEN.pixmap());
|
|
||||||
updateUi();
|
updateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user