GammaRay API Documentation  2.11.3
Functions
GammaRay::EnumUtil Namespace Reference

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. More...
 
QString enumToString (const QVariant &value, const char *typeName=nullptr, const QMetaObject *metaObject=nullptr)
 Translates an enum or flag value into a human readable text. More...
 
QMetaEnum metaEnum (const QVariant &value, const char *typeName=nullptr, const QMetaObject *metaObject=nullptr)
 Determine the QMetaEnum for a given enum/flag value. More...
 

Detailed Description

Enum conversion utility functions.

Function Documentation

◆ enumToInt()

int GammaRay::EnumUtil::enumToInt ( const QVariant value,
const QMetaEnum metaEnum 
)

Converts the given enum or flag value into its numerical representation.

Parameters
valueA QVariant holding the enum/flag value, numerical or as actual enum/flag.
metaEnumThe QMetaEnum defining the enum/flag.
Since
2.6

◆ enumToString()

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.

Parameters
valueThe numerical value. Type information from the QVariant are used to find the corresponding QMetaEnum.
typeNameUse this if the value has type int (e.g. the case for QMetaProperty::read).
metaObjectQMetaObject possibly containing the definition of the enum.
Returns
a QString containing the string version of the specified value.
Since
2.6

◆ metaEnum()

QMetaEnum GammaRay::EnumUtil::metaEnum ( const QVariant value,
const char *  typeName = nullptr,
const QMetaObject metaObject = nullptr 
)

Determine the QMetaEnum for a given enum/flag value.

Parameters
valueA QVariant holding the enum/flag value, numerical or as actual enum/flag.
typeNameA type name hint, in case value holds a numeric value.
metaObjectA meta object hint holding the enum definition.
Since
2.6

© 2010-2021 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
GammaRay Qt-application inspection and manipulation tool
https://www.kdab.com/development-resources/qt-tools/gammaray/
Generated on Tue Dec 7 2021 02:34:38 for GammaRay API Documentation by doxygen 1.8.17