mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 22:15:37 +08:00
Allow direct comparison with enum
This commit is contained in:
@@ -93,6 +93,13 @@ namespace BlackMisc
|
|||||||
return static_cast<CastType>(f);
|
return static_cast<CastType>(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Compare with index given by enum
|
||||||
|
template<class EnumType> bool equalsPropertyIndexEnum(EnumType ev)
|
||||||
|
{
|
||||||
|
if (this->m_indexes.size() != 1) { return false; }
|
||||||
|
return static_cast<int>(ev) == m_indexes.first();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! \copydoc CValueObject::convertToQString
|
//! \copydoc CValueObject::convertToQString
|
||||||
virtual QString convertToQString(bool i18n = false) const override;
|
virtual QString convertToQString(bool i18n = false) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user