GammaRay API Documentation  3.2.0
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

© 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 by doxygen 1.9.1