aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-01-08 14:24:11 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-01-13 16:03:59 +0100
commitec5b042736410440b10a00c70715b6701f65ce10 (patch)
tree58fc4b516e37d145788dcb3e0fb2b2984ee99a2a /src/qml/common
parent2996fb835962750845702db4a9ded257f3f1a9b0 (diff)
QtQml: Move inlineComponentId() into base CU
Change-Id: Icfc234c0354c27f8ff353f49c16c3d99a14e7ea7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/common')
-rw-r--r--src/qml/common/qv4compileddata_p.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h
index bd94332f76..1d6cbb9742 100644
--- a/src/qml/common/qv4compileddata_p.h
+++ b/src/qml/common/qv4compileddata_p.h
@@ -1626,6 +1626,19 @@ public:
return propertyCaches.at(/*root object*/0);
}
+ int inlineComponentId(const QString &inlineComponentName) const
+ {
+ for (uint i = 0; i < qmlData->nObjects; ++i) {
+ auto *object = qmlData->objectAt(i);
+ for (auto it = object->inlineComponentsBegin(), end = object->inlineComponentsEnd();
+ it != end; ++it) {
+ if (stringAt(it->nameIndex) == inlineComponentName)
+ return it->objectIndex;
+ }
+ }
+ return -1;
+ }
+
private:
QString m_fileName; // initialized from data->sourceFileIndex
QString m_finalUrlString; // initialized from data->finalUrlIndex