Allow direct comparison with enum

This commit is contained in:
Klaus Basan
2014-12-20 18:11:19 +01:00
parent ce57c573df
commit a03bd4d07f

View File

@@ -93,6 +93,13 @@ namespace BlackMisc
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:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;