diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-09-17 17:27:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 14:27:10 +0200 |
commit | 8d441936d2e8ab8c39a66831a658c192b80ca597 (patch) | |
tree | 61d71c983c685551d403c5b9b91b0e9075c40fc1 /src/qml/qml/qqmlcompiler_p.h | |
parent | c5a8d5b331352e9a1a0a4be7571add641b22238c (diff) |
[new compiler] Initial support for components
We use a dedicated pass through the objects in QV4::CompiledData::QmlUnit to determine
which objects are QQmlComponents. We remember their object indices as well as to which
component other objects belong to (if any).
Change-Id: I97929c57e2ccb2fd380d612002d128359c4bc253
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler_p.h')
-rw-r--r-- | src/qml/qml/qqmlcompiler_p.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h index 52d6fe210c..9e63ecb22c 100644 --- a/src/qml/qml/qqmlcompiler_p.h +++ b/src/qml/qml/qqmlcompiler_p.h @@ -140,8 +140,11 @@ public: // --- new compiler QV4::CompiledData::CompilationUnit *compilationUnit; QV4::CompiledData::QmlUnit *qmlUnit; - // ### sub-context support - QHash<int, int> objectIndexToId; + // index in first hash is component index, hash inside maps from object index in that scope to integer id + QHash<int, QHash<int, int> > objectIndexToIdPerComponent; + QHash<int, int> objectIndexToIdForRoot; + + bool isComponent(int objectIndex) const { return objectIndexToIdPerComponent.contains(objectIndex); } // --- struct Instruction { |