| 37 | } |
| 38 | |
| 39 | PropertyData 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 | |
| 59 | void QmlContextPropertyAdaptor::writeProperty(int index, const QVariant &value) |
| 60 | { |
nothing calls this directly
no test coverage detected