diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2021-05-28 11:22:12 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2021-06-03 10:30:53 +0200 |
commit | 93b5744c2884213225b6e70baaf98e61e8f225a0 (patch) | |
tree | 4016d2f9862ab337f5b94c6e888731e9746bf3cb /src/qmltyperegistrar | |
parent | 06893b68c6b1f70cb7ff255db1fa9d14697403fa (diff) |
Pass property index from MOC to QQmlJSMetaProperty
This index corresponds to what QMetaObject::indexOfProperty
returns for the same property at run time
Change-Id: I3868aa8651f75d774026cb27438cea16bca698d7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmltyperegistrar')
-rw-r--r-- | src/qmltyperegistrar/qmltypescreator.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmltyperegistrar/qmltypescreator.cpp b/src/qmltyperegistrar/qmltypescreator.cpp index a79c1326a0..c5b4bfd54f 100644 --- a/src/qmltyperegistrar/qmltypescreator.cpp +++ b/src/qmltyperegistrar/qmltypescreator.cpp @@ -193,6 +193,10 @@ void QmlTypesCreator::writeProperties(const QJsonArray &properties) const auto notify = obj.constFind(QLatin1String("notify")); if (notify != obj.constEnd()) m_qml.writeScriptBinding(QLatin1String("notify"), enquote(notify->toString())); + const auto index = obj.constFind(QLatin1String("index")); + if (index != obj.constEnd()) + m_qml.writeScriptBinding(QLatin1String("index"), + QString::number(index.value().toInt())); } if (!obj.contains(QLatin1String("write")) && !obj.contains(QLatin1String("member"))) |