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

Method propertyData

plugins/qmlsupport/qmlcontextpropertyadaptor.cpp:39–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39PropertyData QmlContextPropertyAdaptor::propertyData(int index) const
40{
41 PropertyData pd;
42 if (!object().isValid())
43 return pd;
44
45 Q_ASSERT(index >= 0);
46 Q_ASSERT(index < m_contextPropertyNames.size());
47
48 auto context = qobject_cast<QQmlContext *>(object().qtObject());
49 if (!context)
50 return pd;
51
52 pd.setName(m_contextPropertyNames.at(index));
53 pd.setValue(context->contextProperty(m_contextPropertyNames.at(index)));
54 pd.setClassName(tr("QML Context Property"));
55 pd.setAccessFlags(PropertyData::Writable);
56 return pd;
57}
58
59void QmlContextPropertyAdaptor::writeProperty(int index, const QVariant &value)
60{

Callers

nothing calls this directly

Calls 8

objectFunction · 0.85
qtObjectMethod · 0.80
setAccessFlagsMethod · 0.80
isValidMethod · 0.45
sizeMethod · 0.45
setNameMethod · 0.45
setValueMethod · 0.45
setClassNameMethod · 0.45

Tested by

no test coverage detected