mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Issue #77 toIcon returns a simple enum instead of a full object
This commit is contained in:
@@ -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++);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
this->addItem(country.toPixmap(), d);
|
||||
this->addItem(CIcon(country.toIcon()).toPixmap(), d);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()); }
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace BlackGui
|
||||
this->clear();
|
||||
for (const CEcosystem &e : m_systems)
|
||||
{
|
||||
this->addItem(e.toIcon().toPixmap(), e.getSystemString());
|
||||
this->addItem(BlackMisc::CIcon(e.toIcon()).toPixmap(), e.getSystemString());
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BlackGui
|
||||
ui->cb_Military->setChecked(icao.isMilitary());
|
||||
ui->country_Selector->setCountry(icao.getCountry());
|
||||
|
||||
const QPixmap pm = icao.toPixmap();
|
||||
const QPixmap pm = CIcon(icao.toIcon());
|
||||
if (pm.width() < 125)
|
||||
{
|
||||
ui->lbl_AirlineIcon->setPixmap(pm);
|
||||
|
||||
@@ -50,17 +50,17 @@ namespace BlackGui
|
||||
{
|
||||
CStatusMessage msg;
|
||||
msg.setSeverity(CStatusMessage::SeverityError);
|
||||
ui->rb_Error->setIcon(msg.toIcon().toQIcon());
|
||||
ui->rb_Error->setIcon(CIcon(msg.toIcon()).toQIcon());
|
||||
ui->rb_Error->setToolTip(msg.getSeverityAsString());
|
||||
ui->rb_Error->setText(oneCharacterText ? msg.getSeverityAsString().left(1) : "");
|
||||
|
||||
msg.setSeverity(CStatusMessage::SeverityWarning);
|
||||
ui->rb_Warning->setIcon(msg.toIcon().toQIcon());
|
||||
ui->rb_Warning->setIcon(CIcon(msg.toIcon()).toQIcon());
|
||||
ui->rb_Warning->setToolTip(msg.getSeverityAsString());
|
||||
ui->rb_Warning->setText(oneCharacterText ? msg.getSeverityAsString().left(1) : "");
|
||||
|
||||
msg.setSeverity(CStatusMessage::SeverityInfo);
|
||||
ui->rb_Info->setIcon(msg.toIcon().toQIcon());
|
||||
ui->rb_Info->setIcon(CIcon(msg.toIcon()).toQIcon());
|
||||
ui->rb_Info->setToolTip(msg.getSeverityAsString());
|
||||
ui->rb_Info->setText(oneCharacterText ? msg.getSeverityAsString().left(1) : "");
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace BlackGui
|
||||
|
||||
this->show();
|
||||
m_timerStatusBar.start(3000); // start / restart
|
||||
m_statusBarIcon->setPixmap(statusMessage.toPixmap());
|
||||
m_statusBarIcon->setPixmap(CIcon(statusMessage.toIcon()));
|
||||
|
||||
// restrict size for own status bars
|
||||
const QSize size = m_statusBar->window()->size();
|
||||
|
||||
@@ -421,7 +421,7 @@ namespace BlackGui
|
||||
{
|
||||
const CRgbColor rgbColor(dataCVariant.to<CRgbColor>());
|
||||
if (!rgbColor.isValid()) { return emptyPixmapVariant(); }
|
||||
return CVariant::fromValue(rgbColor.toPixmap());
|
||||
return CVariant::fromValue(CIcon(rgbColor.toIcon()).toPixmap());
|
||||
}
|
||||
|
||||
CVariant CColorFormatter::tooltipRole(const CVariant &dataCVariant) const
|
||||
|
||||
@@ -94,17 +94,17 @@ namespace BlackMisc
|
||||
return QStringLiteral("{ %1, %2, %3, %4 }").arg(this->getApplicationAsString(), m_exePath, m_version, m_process.convertToQString(i18n));
|
||||
}
|
||||
|
||||
CIcon CApplicationInfo::toIcon() const
|
||||
CIcons::IconIndex CApplicationInfo::toIcon() const
|
||||
{
|
||||
switch (getApplication())
|
||||
{
|
||||
case Laucher: return CIconList::allIcons().findByIndex(CIcons::SwiftLauncher16);
|
||||
case PilotClientCore: return CIconList::allIcons().findByIndex(CIcons::SwiftCore16);
|
||||
case PilotClientGui: return CIconList::allIcons().findByIndex(CIcons::Swift16);
|
||||
case MappingTool: return CIconList::allIcons().findByIndex(CIcons::SwiftDatabase16);
|
||||
case Laucher: return CIcons::SwiftLauncher16;
|
||||
case PilotClientCore: return CIcons::SwiftCore16;
|
||||
case PilotClientGui: return CIcons::Swift16;
|
||||
case MappingTool: return CIcons::SwiftDatabase16;
|
||||
default: break;
|
||||
}
|
||||
return CIconList::allIcons().findByIndex(CIcons::StandardIconUnknown16);
|
||||
return CIcons::StandardIconUnknown16;
|
||||
}
|
||||
|
||||
CVariant CApplicationInfo::propertyByIndex(const CPropertyIndex &index) const
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
@@ -175,15 +175,15 @@ namespace BlackMisc
|
||||
return this->hasValidDesignator() && this->hasValidCountry() && this->hasName();
|
||||
}
|
||||
|
||||
CIcon CAirlineIcaoCode::toIcon() const
|
||||
CIcons::IconIndex CAirlineIcaoCode::toIcon() const
|
||||
{
|
||||
if (this->hasValidDbKey() && CAirlineIcaoCode::iconIds().contains(this->getDbKey()))
|
||||
{
|
||||
static const QString p("airlines/%1_%2.png");
|
||||
const QString n(p.arg(this->getDbKey(), 5, 10, QChar('0')).arg(this->getDesignator()));
|
||||
return CIcon(n, this->convertToQString());
|
||||
}
|
||||
return CIcon::iconByIndex(CIcons::StandardIconEmpty);
|
||||
//if (this->hasValidDbKey() && CAirlineIcaoCode::iconIds().contains(this->getDbKey()))
|
||||
//{
|
||||
// static const QString p("airlines/%1_%2.png");
|
||||
// const QString n(p.arg(this->getDbKey(), 5, 10, QChar('0')).arg(this->getDesignator()));
|
||||
// return CIcon(n, this->convertToQString());
|
||||
//}
|
||||
return CIcons::StandardIconEmpty;
|
||||
}
|
||||
|
||||
QString CAirlineIcaoCode::getIconResourcePath() const
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace BlackMisc
|
||||
CAirlineIcaoCode thisOrCallsignCode(const CCallsign &callsign) const;
|
||||
|
||||
//! \copydoc Mixin::Icon::toIcon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -403,9 +403,9 @@ namespace BlackMisc
|
||||
return e;
|
||||
}
|
||||
|
||||
CIcon CAltitude::toIcon() const
|
||||
CIcons::IconIndex CAltitude::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition);
|
||||
return CIcons::GeoPosition;
|
||||
}
|
||||
|
||||
int CAltitude::compare(const CAltitude &otherAltitude) const
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace BlackMisc
|
||||
static QString fpAltitudeExamples();
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
BlackMisc::CIcon toIcon() const;
|
||||
BlackMisc::CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc PhysicalQuantities::CPhysicalQuantity::compare
|
||||
int compare(const CAltitude &otherAltitude) const;
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
BlackMisc::CIcon toIcon() const { return m_callsign.toIcon(); }
|
||||
BlackMisc::CIcons::IconIndex toIcon() const { return m_callsign.toIcon(); }
|
||||
|
||||
private:
|
||||
CCallsign m_callsign;
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace BlackMisc
|
||||
bool isValid() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const { return convertToIcon(*this); }
|
||||
CIcons::IconIndex toIcon() const { return convertToIcon(*this).getIndex(); }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
@@ -960,9 +960,9 @@ namespace BlackMisc
|
||||
return p;
|
||||
}
|
||||
|
||||
CIcon CFlightPlan::toIcon() const
|
||||
CIcons::IconIndex CFlightPlan::toIcon() const
|
||||
{
|
||||
return CIcon::iconByIndex(CIcons::StandardIconAppFlightPlan16);
|
||||
return CIcons::StandardIconAppFlightPlan16;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -379,7 +379,7 @@ namespace BlackMisc
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString()
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -23,16 +23,16 @@ namespace BlackMisc
|
||||
this->setSimplifiedNameIfNotSame();
|
||||
}
|
||||
|
||||
CIcon CCountry::toIcon() const
|
||||
CIcons::IconIndex CCountry::toIcon() const
|
||||
{
|
||||
if (m_dbKey.length() == 2)
|
||||
//if (m_dbKey.length() == 2)
|
||||
//{
|
||||
// // relative to images
|
||||
// return CIcon(u"flags/" % m_dbKey.toLower() % u".png", this->convertToQString());
|
||||
//}
|
||||
//else
|
||||
{
|
||||
// relative to images
|
||||
return CIcon(u"flags/" % m_dbKey.toLower() % u".png", this->convertToQString());
|
||||
}
|
||||
else
|
||||
{
|
||||
return CIcon::iconByIndex(CIcons::StandardIconEmpty);
|
||||
return CIcons::StandardIconEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackMisc
|
||||
bool isValid() const;
|
||||
|
||||
//! Representing icon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! DB ISO code
|
||||
const QString &getIsoCode() const { return m_dbKey; }
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace BlackMisc
|
||||
return !m_downloadUrls.isEmpty();
|
||||
}
|
||||
|
||||
CIcon CDistribution::getRestrictionIcon() const
|
||||
CIcons::IconIndex CDistribution::getRestrictionIcon() const
|
||||
{
|
||||
// StandardIconLockOpen16 is hard to distinguish from closed
|
||||
return CIcon::iconByIndex(m_restricted ? CIcons::StandardIconLockClosed16 : CIcons::StandardIconGlobe16);
|
||||
return m_restricted ? CIcons::StandardIconLockClosed16 : CIcons::StandardIconGlobe16;
|
||||
}
|
||||
|
||||
bool CDistribution::isStabilitySameOrBetter(const CDistribution &otherDistribution) const
|
||||
@@ -74,7 +74,7 @@ namespace BlackMisc
|
||||
this->getFormattedUtcTimestampYmdhms();
|
||||
}
|
||||
|
||||
CIcon CDistribution::toIcon() const
|
||||
CIcons::IconIndex CDistribution::toIcon() const
|
||||
{
|
||||
return this->getRestrictionIcon();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace BlackMisc
|
||||
void setRestricted(bool r) { m_restricted = r; }
|
||||
|
||||
//! Get the restrict icon
|
||||
CIcon getRestrictionIcon() const;
|
||||
CIcons::IconIndex getRestrictionIcon() const;
|
||||
|
||||
//! "this" having same or better stability than other distribution?
|
||||
bool isStabilitySameOrBetter(const CDistribution &otherDistribution) const;
|
||||
@@ -95,7 +95,7 @@ namespace BlackMisc
|
||||
QString convertToQString(const QString &separator, bool i18n = false) const;
|
||||
|
||||
//! Representing icon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
@@ -161,9 +161,9 @@ namespace BlackMisc
|
||||
LATorLON *CEarthAngle<LATorLON>::derived() { return static_cast<LATorLON *>(this); }
|
||||
|
||||
template <class LATorLON>
|
||||
CIcon CEarthAngle<LATorLON>::toIcon() const
|
||||
CIcons::IconIndex CEarthAngle<LATorLON>::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition);
|
||||
return CIcons::GeoPosition;
|
||||
}
|
||||
|
||||
template<class LATorLON>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace BlackMisc
|
||||
LATorLON operator *(double multiply) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
/*!
|
||||
* Latitude / Longitude from a WGS string such as
|
||||
|
||||
@@ -15,20 +15,23 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
CIcon::CIcon(CIcons::IconIndex index) :
|
||||
CIcon(iconByIndex(index)) {}
|
||||
|
||||
CIcon::CIcon(CIcons::IconIndex index, const QString &descriptiveText) :
|
||||
m_index(index), m_descriptiveText(descriptiveText) {}
|
||||
|
||||
CIcon::CIcon(const QPixmap &pixmap, const QString &descriptiveText) :
|
||||
m_index(CIcons::IconIsGenerated), m_descriptiveText(descriptiveText), m_pixmap(pixmap)
|
||||
{ }
|
||||
//CIcon::CIcon(const QPixmap &pixmap, const QString &descriptiveText) :
|
||||
// m_index(CIcons::IconIsGenerated), m_descriptiveText(descriptiveText), m_pixmap(pixmap)
|
||||
//{ }
|
||||
|
||||
CIcon::CIcon(const QString &resourceFilePath, const QString &descriptiveText) :
|
||||
m_index(CIcons::IconIsFile), m_descriptiveText(descriptiveText)
|
||||
{
|
||||
QString fullPath;
|
||||
m_pixmap = CIcons::pixmapByResourceFileName(QDir::cleanPath(resourceFilePath), fullPath);
|
||||
m_fileResourcePath = fullPath;
|
||||
}
|
||||
//CIcon::CIcon(const QString &resourceFilePath, const QString &descriptiveText) :
|
||||
// m_index(CIcons::IconIsFile), m_descriptiveText(descriptiveText)
|
||||
//{
|
||||
// QString fullPath;
|
||||
// m_pixmap = CIcons::pixmapByResourceFileName(QDir::cleanPath(resourceFilePath), fullPath);
|
||||
// m_fileResourcePath = fullPath;
|
||||
//}
|
||||
|
||||
CIcons::IconIndex CIcon::getIndex() const
|
||||
{
|
||||
|
||||
@@ -48,14 +48,17 @@ namespace BlackMisc
|
||||
//! Default constructor.
|
||||
CIcon() {}
|
||||
|
||||
//! Constructor.
|
||||
CIcon(CIcons::IconIndex index);
|
||||
|
||||
//! Constructor.
|
||||
CIcon(CIcons::IconIndex index, const QString &descriptiveText);
|
||||
|
||||
//! Constructor for generated icon
|
||||
CIcon(const QPixmap &pixmap, const QString &descriptiveText);
|
||||
//CIcon(const QPixmap &pixmap, const QString &descriptiveText);
|
||||
|
||||
//! Constructor for file icons
|
||||
CIcon(const QString &resourceFilePath, const QString &descriptiveText);
|
||||
//CIcon(const QString &resourceFilePath, const QString &descriptiveText);
|
||||
|
||||
//! Get descriptive text
|
||||
const QString &getDescriptiveText() const { return m_descriptiveText; }
|
||||
@@ -85,7 +88,7 @@ namespace BlackMisc
|
||||
QPixmap toPixmap() const;
|
||||
|
||||
//! Identity function
|
||||
CIcon toIcon() const { return *this; }
|
||||
CIcons::IconIndex toIcon() const { return m_index; }
|
||||
|
||||
//! A QIcon
|
||||
QIcon toQIcon() const;
|
||||
@@ -123,12 +126,6 @@ namespace BlackMisc
|
||||
BLACK_METAMEMBER(fileResourcePath)
|
||||
);
|
||||
};
|
||||
|
||||
namespace Private
|
||||
{
|
||||
//! \private Needed so CValueObjectMetaInfoHelper can copy forward-declared CIcon.
|
||||
inline void assign(CIcon &a, const CIcon &b) { a = b; }
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CIcon)
|
||||
|
||||
@@ -31,10 +31,7 @@ namespace BlackMisc
|
||||
{
|
||||
public:
|
||||
//! As icon, not implemented by all classes
|
||||
CIcon toIcon() const { return CIcon::iconByIndex(IconIndex); }
|
||||
|
||||
//! As pixmap, required for most GUI views
|
||||
QPixmap toPixmap() const { return derived()->toIcon().toPixmap(); }
|
||||
CIcons::IconIndex toIcon() const { return IconIndex; }
|
||||
|
||||
private:
|
||||
const Derived *derived() const { return static_cast<const Derived *>(this); }
|
||||
@@ -46,8 +43,7 @@ namespace BlackMisc
|
||||
* the derived class uses this macro to disambiguate the inherited members.
|
||||
*/
|
||||
# define BLACKMISC_DECLARE_USING_MIXIN_ICON(DERIVED) \
|
||||
using ::BlackMisc::Mixin::Icon<DERIVED>::toIcon; \
|
||||
using ::BlackMisc::Mixin::Icon<DERIVED>::toPixmap;
|
||||
using ::BlackMisc::Mixin::Icon<DERIVED>::toIcon;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -155,8 +155,8 @@ namespace BlackMisc
|
||||
const auto i = index.frontCasted<ColumnIndex>(); // keep that "auto", otherwise I won's compile
|
||||
switch (i)
|
||||
{
|
||||
case IndexIcon: return CVariant::from(derived()->toIcon());
|
||||
case IndexPixmap: return CVariant::from(derived()->toPixmap());
|
||||
case IndexIcon: return CVariant::from(CIcon(derived()->toIcon()));
|
||||
case IndexPixmap: return CVariant::from(CIcon(derived()->toIcon()).toPixmap());
|
||||
case IndexString: return CVariant(derived()->toQString());
|
||||
default: return basePropertyByIndex(static_cast<const TIndexBaseOfT<Derived> *>(derived()), index);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace BlackMisc
|
||||
: m_name(name), m_variant(variant), m_icon(icon)
|
||||
{ }
|
||||
|
||||
CIcon CNameVariantPair::toIcon() const { return m_icon; }
|
||||
CIcons::IconIndex CNameVariantPair::toIcon() const { return m_icon.getIndex(); }
|
||||
|
||||
bool CNameVariantPair::hasIcon() const
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackMisc
|
||||
void setVariant(const CVariant &variant) { m_variant = variant; }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
BlackMisc::CIcon toIcon() const;
|
||||
BlackMisc::CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! Has icon
|
||||
bool hasIcon() const;
|
||||
|
||||
@@ -122,9 +122,9 @@ namespace BlackMisc
|
||||
return this->hasBulkRole() || this->hasBulkAddRole();
|
||||
}
|
||||
|
||||
CIcon CAuthenticatedUser::toIcon() const
|
||||
CIcons::IconIndex CAuthenticatedUser::toIcon() const
|
||||
{
|
||||
return CIcon::iconByIndex(CIcons::StandardIconUser16);
|
||||
return CIcons::StandardIconUser16;
|
||||
}
|
||||
|
||||
CVariant CAuthenticatedUser::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace BlackMisc
|
||||
bool canDirectlyWriteModels() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
BlackMisc::CIcon toIcon() const;
|
||||
BlackMisc::CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
@@ -96,12 +96,11 @@ namespace BlackMisc
|
||||
if (!modelString.isEmpty()) { this->addCapability(CClient::FsdModelString); }
|
||||
}
|
||||
|
||||
CIcon CClient::toIcon() const
|
||||
CIcons::IconIndex CClient::toIcon() const
|
||||
{
|
||||
if (!m_swift) { return m_user.toIcon(); }
|
||||
|
||||
static const CIcon swift = CIconList::allIcons().findByIndex(CIcons::Swift16);
|
||||
return swift;
|
||||
return CIcons::Swift16;
|
||||
}
|
||||
|
||||
CVariant CClient::propertyByIndex(const CPropertyIndex &index) const
|
||||
@@ -117,8 +116,8 @@ namespace BlackMisc
|
||||
case IndexModelString: return CVariant(m_modelString);
|
||||
case IndexServer: return CVariant(m_server);
|
||||
case IndexVoiceCapabilities: return m_voiceCapabilities.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexVoiceCapabilitiesPixmap: return CVariant::from(m_voiceCapabilities.toPixmap());
|
||||
case IndexVoiceCapabilitiesIcon: return CVariant::fromValue(m_voiceCapabilities.toIcon());
|
||||
case IndexVoiceCapabilitiesPixmap: return CVariant::from(CIcon(m_voiceCapabilities.toIcon()).toPixmap());
|
||||
case IndexVoiceCapabilitiesIcon: return CVariant::from(CIcon(m_voiceCapabilities.toIcon()));
|
||||
case IndexVoiceCapabilitiesString: return CVariant(m_voiceCapabilities.toQString(true));
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace BlackMisc
|
||||
void setQueriedModelString(const QString &modelString);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
@@ -72,17 +72,17 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
CIcon CEcosystem::toIcon() const
|
||||
CIcons::IconIndex CEcosystem::toIcon() const
|
||||
{
|
||||
switch (this->getSystem())
|
||||
{
|
||||
case VATSIM: return CIconList::allIcons().findByIndex(CIcons::NetworkVatsimLogo);
|
||||
case Swift: return CIconList::allIcons().findByIndex(CIcons::Swift24);
|
||||
case SwiftTest: return CIconList::allIcons().findByIndex(CIcons::Swift24);
|
||||
case PrivateFSD: return CIconList::allIcons().findByIndex(CIcons::StandardIconAppAircraft16);
|
||||
case NoSystem: return CIconList::allIcons().findByIndex(CIcons::StandardIconCrossCircle16);
|
||||
case VATSIM: return CIcons::NetworkVatsimLogo;
|
||||
case Swift: return CIcons::Swift24;
|
||||
case SwiftTest: return CIcons::Swift24;
|
||||
case PrivateFSD: return CIcons::StandardIconAppAircraft16;
|
||||
case NoSystem: return CIcons::StandardIconCrossCircle16;
|
||||
case Unspecified:
|
||||
default: return CIconList::allIcons().findByIndex(CIcons::StandardIconUnknown16);
|
||||
default: return CIcons::StandardIconUnknown16;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace BlackMisc
|
||||
const QString &getSystemString() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
@@ -292,14 +292,14 @@ namespace BlackMisc
|
||||
return std::move(candidate).right(4).toUpper();
|
||||
}
|
||||
|
||||
CIcon CTextMessage::toIcon() const
|
||||
CIcons::IconIndex CTextMessage::toIcon() const
|
||||
{
|
||||
return m_senderCallsign.toIcon();
|
||||
}
|
||||
|
||||
QPixmap CTextMessage::toPixmap() const
|
||||
{
|
||||
return m_senderCallsign.toPixmap();
|
||||
return CIcon(toIcon()).toPixmap();
|
||||
}
|
||||
|
||||
CVariant CTextMessage::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace BlackMisc
|
||||
QString getSelcalCode() const;
|
||||
|
||||
//! As icon, not implement by all classes
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! As pixmap, required for most GUI views
|
||||
QPixmap toPixmap() const;
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace BlackMisc
|
||||
bool setCallsign(const Aviation::CCallsign &callsign);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const { return this->getCallsign().toIcon(); }
|
||||
CIcons::IconIndex toIcon() const { return this->getCallsign().toIcon(); }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||
|
||||
@@ -80,18 +80,18 @@ namespace BlackMisc
|
||||
this->setCapabilities(Unknown);
|
||||
}
|
||||
|
||||
CIcon CVoiceCapabilities::toIcon() const
|
||||
CIcons::IconIndex CVoiceCapabilities::toIcon() const
|
||||
{
|
||||
switch (m_voiceCapabilities)
|
||||
{
|
||||
case Voice: return CIcon::iconByIndex(CIcons::NetworkCapabilityVoiceBackground);
|
||||
case TextOnly: return CIcon::iconByIndex(CIcons::NetworkCapabilityTextOnly);
|
||||
case VoiceReceivingOnly: return CIcon::iconByIndex(CIcons::NetworkCapabilityVoiceReceiveOnlyBackground);
|
||||
case Unknown: return CIcon::iconByIndex(CIcons::NetworkCapabilityUnknown);
|
||||
case Voice: return CIcons::NetworkCapabilityVoiceBackground;
|
||||
case TextOnly: return CIcons::NetworkCapabilityTextOnly;
|
||||
case VoiceReceivingOnly: return CIcons::NetworkCapabilityVoiceReceiveOnlyBackground;
|
||||
case Unknown: return CIcons::NetworkCapabilityUnknown;
|
||||
default: break;
|
||||
}
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Illegal mode");
|
||||
return CIcon::iconByIndex(CIcons::NetworkCapabilityUnknown); // never reached
|
||||
return CIcons::NetworkCapabilityUnknown; // never reached
|
||||
}
|
||||
|
||||
const CVoiceCapabilities &CVoiceCapabilities::fromVoiceCapabilities(CVoiceCapabilities::VoiceCapabilities capabilities)
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace BlackMisc
|
||||
static const QList<CVoiceCapabilities> &allCapabilities();
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackMisc
|
||||
//! With Pixmap?
|
||||
bool isNull() const;
|
||||
|
||||
//! \copydoc CValueObject::toPixmap
|
||||
//! \copydoc CIcon::toPixmap
|
||||
QPixmap toPixmap() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
|
||||
@@ -64,18 +64,18 @@ namespace BlackMisc
|
||||
return this->convertToQString(true);
|
||||
}
|
||||
|
||||
CIcon CPlatform::toIcon() const
|
||||
CIcons::IconIndex CPlatform::toIcon() const
|
||||
{
|
||||
if (this->getPlatform() == All) { return CIcon::iconByIndex(CIcons::OSAll); }
|
||||
if (this->getPlatform() == All) { return CIcons::OSAll; }
|
||||
switch (this->getPlatformFlag())
|
||||
{
|
||||
case Win32:
|
||||
case Win64: return CIcon::iconByIndex(CIcons::OSWindows);
|
||||
case Linux: return CIcon::iconByIndex(CIcons::OSLinux);
|
||||
case MacOS: return CIcon::iconByIndex(CIcons::OSMacOs);
|
||||
case Win64: return CIcons::OSWindows;
|
||||
case Linux: return CIcons::OSLinux;
|
||||
case MacOS: return CIcons::OSMacOs;
|
||||
default: break;
|
||||
}
|
||||
return CIcon::iconByIndex(CIcons::StandardIconEmpty);
|
||||
return CIcons::StandardIconEmpty;
|
||||
}
|
||||
|
||||
QString CPlatform::convertToQString(bool i18n) const
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace BlackMisc
|
||||
void setPlatform(const QString &p) { setPlatform(stringToPlatform(p)); }
|
||||
|
||||
//! Representing icon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -49,11 +49,9 @@ namespace BlackMisc
|
||||
minutes = std::copysign(minutes, degrees);
|
||||
}
|
||||
|
||||
CIcon CAngle::toIcon() const
|
||||
CIcons::IconIndex CAngle::toIcon() const
|
||||
{
|
||||
CIcon i = CIcon::iconByIndex(CIcons::StandardIconArrowMediumNorth16);
|
||||
i.setRotation(value(CAngleUnit::deg()));
|
||||
return i;
|
||||
return CIcons::StandardIconArrowMediumNorth16;
|
||||
}
|
||||
|
||||
CAngle::DegMinSecFractionalSec CAngle::asSexagesimalDegMinSec(bool range180Degrees) const
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace BlackMisc
|
||||
static void unifySign(int degrees, int &minutes);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
BlackMisc::CIcon toIcon() const;
|
||||
BlackMisc::CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! As individual values
|
||||
DegMinSecFractionalSec asSexagesimalDegMinSec(bool range180Degrees = false) const;
|
||||
|
||||
@@ -37,22 +37,22 @@ namespace BlackMisc
|
||||
this->setQColor(color);
|
||||
}
|
||||
|
||||
CIcon CRgbColor::toIcon() const
|
||||
CIcons::IconIndex CRgbColor::toIcon() const
|
||||
{
|
||||
if (this->isValid())
|
||||
//if (this->isValid())
|
||||
//{
|
||||
// QPixmap pixmap(QSize(16, 16));
|
||||
// QPainter p(&pixmap);
|
||||
// QBrush brush(this->toQColor());
|
||||
// p.setBackground(brush);
|
||||
// p.setBrush(this->toQColor());
|
||||
// p.drawRect(0, 0, 16, 16);
|
||||
// CIcon icon(pixmap, hex());
|
||||
// return icon;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
QPixmap pixmap(QSize(16, 16));
|
||||
QPainter p(&pixmap);
|
||||
QBrush brush(this->toQColor());
|
||||
p.setBackground(brush);
|
||||
p.setBrush(this->toQColor());
|
||||
p.drawRect(0, 0, 16, 16);
|
||||
CIcon icon(pixmap, hex());
|
||||
return icon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CIcon::iconByIndex(CIcons::StandardIconError16);
|
||||
return CIcons::StandardIconError16;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace BlackMisc
|
||||
void setInvalid();
|
||||
|
||||
//! Representing icon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -460,7 +460,7 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const { return m_callsign.toIcon(); }
|
||||
CIcons::IconIndex toIcon() const { return m_callsign.toIcon(); }
|
||||
|
||||
private:
|
||||
static constexpr int CurrentModel = 0; //!< m_models
|
||||
|
||||
@@ -174,17 +174,17 @@ namespace BlackMisc
|
||||
return str.trimmed();
|
||||
}
|
||||
|
||||
CIcon CSimulatorInfo::toIcon() const
|
||||
CIcons::IconIndex CSimulatorInfo::toIcon() const
|
||||
{
|
||||
if (this->isSingleSimulator())
|
||||
{
|
||||
switch (this->getSimulator())
|
||||
{
|
||||
case FSX: return CIconList::allIcons().findByIndex(CIcons::SimulatorFSX16);
|
||||
case FS9: return CIconList::allIcons().findByIndex(CIcons::SimulatorFS916);
|
||||
case P3D: return CIconList::allIcons().findByIndex(CIcons::SimulatorP3D16);
|
||||
case XPLANE: return CIconList::allIcons().findByIndex(CIcons::SimulatorXPlane16);
|
||||
case FG: return CIconList::allIcons().findByIndex(CIcons::SimulatorXPlane16);
|
||||
case FSX: return CIcons::SimulatorFSX16;
|
||||
case FS9: return CIcons::SimulatorFS916;
|
||||
case P3D: return CIcons::SimulatorP3D16;
|
||||
case XPLANE: return CIcons::SimulatorXPlane16;
|
||||
case FG: return CIcons::SimulatorXPlane16;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! Add simulator
|
||||
CSimulatorInfo add(const CSimulatorInfo &other);
|
||||
|
||||
@@ -463,7 +463,7 @@ namespace BlackMisc
|
||||
void setCategories(const CLogCategoryList &categories) { this->m_categories = categories; }
|
||||
|
||||
//! Representing icon
|
||||
const CIcon &toIcon() const { return convertToIcon(*this); }
|
||||
CIcons::IconIndex toIcon() const { return convertToIcon(*this).getIndex(); }
|
||||
|
||||
//! Severity as string
|
||||
const QString &getSeverityAsString() const;
|
||||
|
||||
@@ -125,9 +125,6 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
using Mixin::Icon<Derived>::toIcon;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toPixmap
|
||||
using Mixin::Icon<Derived>::toPixmap;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::MetaType::isA
|
||||
using Mixin::MetaType<Derived>::isA;
|
||||
|
||||
|
||||
@@ -508,20 +508,18 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
CIcon CVariant::toIcon() const
|
||||
CIcons::IconIndex CVariant::toIcon() const
|
||||
{
|
||||
auto *meta = getValueObjectMetaInfo();
|
||||
if (! meta) { return {}; }
|
||||
try
|
||||
{
|
||||
CIcon result;
|
||||
meta->toIcon(data(), result);
|
||||
return result;
|
||||
return static_cast<CIcons::IconIndex>(meta->toIcon(data()));
|
||||
}
|
||||
catch (const Private::CVariantException &ex)
|
||||
{
|
||||
CLogMessage(this).debug() << ex.what();
|
||||
return {};
|
||||
return CIcons::StandardIconError16;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,7 +529,7 @@ namespace BlackMisc
|
||||
if (m_v.type() == QVariant::Image) { return QPixmap::fromImage(m_v.value<QImage>()); }
|
||||
if (m_v.type() == QVariant::Icon) { return iconToPixmap(m_v.value<QIcon>()); }
|
||||
|
||||
return toIcon().toPixmap();
|
||||
return CIcon(toIcon()).toPixmap();
|
||||
}
|
||||
|
||||
bool CVariant::matches(const CVariant &value) const
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "blackmisc/mixin/mixinstring.h"
|
||||
#include "blackmisc/mixin/mixinmetatype.h"
|
||||
#include "blackmisc/variantprivate.h"
|
||||
#include "blackmisc/icons.h"
|
||||
|
||||
#include <QDBusArgument>
|
||||
#include <QDateTime>
|
||||
@@ -255,11 +256,11 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::equalsPropertyByIndex
|
||||
bool equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc CValueObject::toPixmap
|
||||
//! \copydoc CIcon::toPixmap
|
||||
QPixmap toPixmap() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon
|
||||
CIcon toIcon() const;
|
||||
CIcons::IconIndex toIcon() const;
|
||||
|
||||
//! If this is an event subscription, return true if it matches the given event.
|
||||
bool matches(const CVariant &event) const;
|
||||
|
||||
@@ -38,9 +38,6 @@ namespace BlackMisc
|
||||
//! \private Defined in variant.h
|
||||
void assign(CVariant &, const CVariant &);
|
||||
|
||||
//! \private Defined in icon.h
|
||||
void assign(CIcon &, const CIcon &);
|
||||
|
||||
//! \private Abstract base class representing the set of operations supported by a particular value type.
|
||||
struct BLACKMISC_EXPORT IValueObjectMetaInfo
|
||||
{
|
||||
@@ -60,7 +57,7 @@ namespace BlackMisc
|
||||
virtual QString propertyByIndexAsString(const void *object, const CPropertyIndex &index, bool i18n) const = 0;
|
||||
virtual bool equalsPropertyByIndex(const void *object, const CVariant &compareValue, const CPropertyIndex &index) const = 0;
|
||||
virtual bool matches(const void *object, const CVariant &value) const = 0;
|
||||
virtual void toIcon(const void *object, CIcon &o_icon) const = 0;
|
||||
virtual int toIcon(const void *object) const = 0;
|
||||
};
|
||||
|
||||
//! \private Exception to signal that an unsupported operation was requested.
|
||||
@@ -139,9 +136,9 @@ namespace BlackMisc
|
||||
static bool equalsPropertyByIndex(const T &object, const CVariant &, const CPropertyIndex &, ...) { throw CVariantException(object, "equalsPropertyByIndex"); }
|
||||
|
||||
template <typename T>
|
||||
static void toIcon(const T &object, CIcon &o_icon, std::enable_if_t < ! std::is_same<T, CVariant>::value, decltype(static_cast<void>(object.toIcon()), 0) >) { assign(o_icon, object.toIcon()); }
|
||||
static int toIcon(const T &object, std::enable_if_t < ! std::is_same<T, CVariant>::value, decltype(static_cast<void>(object.toIcon()), 0) >) { return object.toIcon(); }
|
||||
template <typename T>
|
||||
static void toIcon(const T &object, CIcon &, ...) { throw CVariantException(object, "toIcon"); }
|
||||
static int toIcon(const T &object, ...) { throw CVariantException(object, "toIcon"); }
|
||||
|
||||
template <typename T>
|
||||
static bool matches(const T &object, const CVariant &value, decltype(static_cast<void>(object.matches(value)), 0)) { return object.matches(value); }
|
||||
@@ -210,9 +207,9 @@ namespace BlackMisc
|
||||
{
|
||||
return CValueObjectMetaInfoHelper::equalsPropertyByIndex(cast(object), compareValue, index, 0);
|
||||
}
|
||||
virtual void toIcon(const void *object, CIcon &o_icon) const override
|
||||
virtual int toIcon(const void *object) const override
|
||||
{
|
||||
CValueObjectMetaInfoHelper::toIcon(cast(object), o_icon, 0);
|
||||
return CValueObjectMetaInfoHelper::toIcon(cast(object), 0);
|
||||
}
|
||||
virtual bool matches(const void *object, const CVariant &value) const override
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user