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

Method displayString

core/util.cpp:40–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38using namespace std;
39
40QString Util::displayString(const QObject *object)
41{
42 if (!object)
43 return QStringLiteral("0x0 (QObject)");
44 const auto name = ObjectDataProvider::name(object);
45 if (name.isEmpty())
46 return QStringLiteral("%1 (%2)").arg(addressToString(object), object->metaObject()->className());
47 const auto typeName = ObjectDataProvider::typeName(object);
48 if (name == typeName)
49 return name;
50 return QStringLiteral("%1 (%2)").arg(ObjectDataProvider::typeName(object), name);
51}
52
53QString Util::shortDisplayString(const QObject *object)
54{

Callers 7

fullTraceMethod · 0.45
testProblemModelMethod · 0.45
testDisplayStringMethod · 0.45
testStackTraceFunction · 0.45
testDisplayStringMethod · 0.45
sourceLocationLabelFunction · 0.45
displayTextMethod · 0.45

Calls 4

addressToStringFunction · 0.85
isEmptyMethod · 0.45
classNameMethod · 0.45
metaObjectMethod · 0.45

Tested by 4

testProblemModelMethod · 0.36
testDisplayStringMethod · 0.36
testStackTraceFunction · 0.36
testDisplayStringMethod · 0.36