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

Function enumToString

core/metaenum.h:38–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template<typename T, std::size_t N>
38QString enumToString(T value, const Value<T> (&lookupTable)[N])
39{
40 for (std::size_t i = 0; i < N; ++i) {
41 if (lookupTable[i].value == value)
42 return QString::fromUtf8(lookupTable[i].name);
43 }
44 return QStringLiteral("unknown (") + QString::number(value) + ')';
45}
46
47template<typename T, typename F, std::size_t N>
48QString flagsToString(T flags, const Value<F> (&lookupTable)[N])

Callers 15

dataMethod · 0.85
headerDataMethod · 0.85
operator()Method · 0.85
displayStringMethod · 0.85
dataMethod · 0.85
argumentDisplayStringMethod · 0.85
enumToStringMethod · 0.85
stringifyPropertyFunction · 0.85
MyObjectClass · 0.85
styleHintToVariantMethod · 0.85
brushToStringFunction · 0.85
penToStringFunction · 0.85

Calls

no outgoing calls

Tested by 2