Issue #77 toIcon returns a simple enum instead of a full object

This commit is contained in:
Mat Sutcliffe
2020-10-26 22:55:10 +00:00
parent 59bbac9a1f
commit b1185eb541
61 changed files with 157 additions and 171 deletions

View File

@@ -76,7 +76,7 @@ namespace BlackGui
QPushButton *button = new QPushButton(this);
button->setText(station.getCallsignAsString());
if (m_withIcons) { button->setIcon(station.toPixmap()); }
if (m_withIcons) { button->setIcon(CIcon(station.toIcon()).toQIcon()); }
QObject::connect(button, &QPushButton::released, this, &CAtcButtonComponent::onButtonClicked);
const CVariant atcv = CVariant::fromValue(station);
layout->addWidget(button, row, col++);

View File

@@ -72,7 +72,7 @@ namespace BlackGui
else
{
ui->le_Color->setText(color.hex());
ui->lbl_ColorIcon->setPixmap(color.toPixmap());
ui->lbl_ColorIcon->setPixmap(CIcon(color.toIcon()));
m_lastColor = color;
}
emit colorChanged(color);
@@ -176,7 +176,7 @@ namespace BlackGui
mimeData->setColorData(QVariant::fromValue(c.toQColor()));
drag->setMimeData(mimeData);
drag->setPixmap(c.toPixmap());
drag->setPixmap(CIcon(c.toIcon()));
Qt::DropAction dropAction = drag->exec(Qt::CopyAction);
Q_UNUSED(dropAction);

View File

@@ -62,7 +62,7 @@ namespace BlackGui
{
ui->le_CountryIso->setText(country.getIsoCode());
ui->le_CountryName->setText(country.getName());
ui->lbl_CountryIcon->setPixmap(country.toPixmap());
ui->lbl_CountryIcon->setPixmap(CIcon(country.toIcon()));
if (country != m_currentCountry)
{
m_currentCountry = country;

View File

@@ -99,7 +99,7 @@ namespace BlackGui
}
else
{
this->addItem(country.toPixmap(), d);
this->addItem(CIcon(country.toIcon()).toPixmap(), d);
}
}
else

View File

@@ -40,7 +40,7 @@ namespace BlackGui
void CStatusMessageForm::setValue(const CStatusMessage &message)
{
ui->te_Message->setPlainText(message.getMessage());
ui->lbl_SeverityIcon->setPixmap(message.toPixmap());
ui->lbl_SeverityIcon->setPixmap(CIcon(message.toIcon()));
const QString hrc(message.getHumanReadablePattern());
if (hrc.isEmpty())
{

View File

@@ -38,7 +38,7 @@ namespace BlackGui
void CStatusMessageFormSmall::setValue(const CStatusMessage &message)
{
ui->te_Message->setPlainText(message.getMessage());
ui->lbl_SeverityIcon->setPixmap(message.toPixmap());
ui->lbl_SeverityIcon->setPixmap(CIcon(message.toIcon()));
ui->le_Categories->setText(message.getHumanOrTechnicalCategoriesAsString());
ui->le_Severity->setText(message.getSeverityAsString());
ui->le_Timestamp->setText(message.getFormattedUtcTimestampYmdhms());

View File

@@ -491,7 +491,7 @@ namespace BlackGui
if (supervisor)
{
//! \fixme hardcoded stylesheet color
bar->setTabIcon(index, callsign.toPixmap());
bar->setTabIcon(index, CIcon(callsign.toIcon()).toQIcon());
bar->setTabTextColor(index, QColor(Qt::yellow));
}
ui->tw_TextMessages->setCurrentIndex(index);

View File

@@ -106,7 +106,7 @@ namespace BlackGui
ui->cb_Platforms->clear();
for (const CPlatform &platform : platforms)
{
ui->cb_Platforms->insertItem(i++, platform.toPixmap(), platform.getPlatformName());
ui->cb_Platforms->insertItem(i++, CIcon(platform.toIcon()).toPixmap(), platform.getPlatformName());
}
if (platforms.contains(settings.last())) { ui->cb_Platforms->setCurrentText(settings.last()); }
else if (platforms.contains(CPlatform::currentPlatform().getPlatformName())) { ui->cb_Platforms->setCurrentText(CPlatform::currentPlatform().getPlatformName()); }
@@ -116,7 +116,7 @@ namespace BlackGui
ui->cb_Channels->clear();
for (const CDistribution &distribution : distributions)
{
ui->cb_Channels->insertItem(i++, distribution.getRestrictionIcon().toPixmap(), distribution.getChannel());
ui->cb_Channels->insertItem(i++, CIcon(distribution.getRestrictionIcon()).toPixmap(), distribution.getChannel());
}
if (distributions.containsChannel(settings.front())) { ui->cb_Channels->setCurrentText(settings.front()); }