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

Function qmlListPropertyToString

plugins/qmlsupport/qmlsupport.cpp:91–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static QString qmlListPropertyToString(const QVariant &value, bool *ok)
92{
93 if (qstrncmp(value.typeName(), "QQmlListProperty<", 17) != 0 || !value.isValid())
94 return QString();
95
96 *ok = true;
97 QQmlListProperty<QObject> *prop = reinterpret_cast<QQmlListProperty<QObject> *>(const_cast<void *>(value.data()));
98 if (!prop || !prop->count)
99 return QString();
100
101 const int count = prop->count(prop);
102 if (!count)
103 return QmlSupport::tr("<empty>");
104
105 return QmlSupport::tr("<%1 entries>").arg(count);
106}
107
108static QString qjsValueToString(const QJSValue &v)
109{

Callers

nothing calls this directly

Calls 5

QStringClass · 0.50
typeNameMethod · 0.45
isValidMethod · 0.45
dataMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected