GammaRay API Documentation 3.0.1
|
Enum conversion utility functions. More...
Functions | |
int | enumToInt (const QVariant &value, const QMetaEnum &metaEnum) |
Converts the given enum or flag value into its numerical representation. | |
QString | enumToString (const QVariant &value, const char *typeName=nullptr, const QMetaObject *metaObject=nullptr) |
Translates an enum or flag value into a human readable text. | |
QMetaEnum | metaEnum (const QVariant &value, const char *typeName=nullptr, const QMetaObject *metaObject=nullptr) |
Determine the QMetaEnum for a given enum/flag value. | |
Enum conversion utility functions.
QString GammaRay::EnumUtil::enumToString | ( | const QVariant & | value, |
const char * | typeName = nullptr , |
||
const QMetaObject * | metaObject = nullptr |
||
) |
Translates an enum or flag value into a human readable text.
value | The numerical value. Type information from the QVariant are used to find the corresponding QMetaEnum. |
typeName | Use this if the value has type int (e.g. the case for QMetaProperty::read). |
metaObject | QMetaObject possibly containing the definition of the enum. |
value
. QMetaEnum GammaRay::EnumUtil::metaEnum | ( | const QVariant & | value, |
const char * | typeName = nullptr , |
||
const QMetaObject * | metaObject = nullptr |
||
) |