MCPcopy Create free account
hub / github.com/KDAB/GammaRay / stringifyProperty

Function stringifyProperty

core/util.cpp:97–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96namespace GammaRay {
97static QString stringifyProperty(const QObject *obj, const QString &propName)
98{
99 const QVariant value = obj->property(propName.toLatin1());
100 const QMetaProperty mp = obj->metaObject()->property(
101 obj->metaObject()->indexOfProperty(propName.toLatin1()));
102 if (mp.isValid()) {
103 const QString enumStr = EnumUtil::enumToString(value, mp.typeName(), obj->metaObject());
104 if (!enumStr.isEmpty())
105 return enumStr;
106 }
107 return VariantHandler::displayString(value);
108}
109
110struct IconCacheEntry
111{

Callers 1

iconIdForObjectFunction · 0.85

Calls 8

enumToStringFunction · 0.85
displayStringFunction · 0.85
indexOfPropertyMethod · 0.80
propertyMethod · 0.45
metaObjectMethod · 0.45
isValidMethod · 0.45
typeNameMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected