diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-10-25 14:23:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-31 16:00:58 +0100 |
commit | 71338b4b2f01268759f7ac6b3eff5abb17420a7c (patch) | |
tree | 9be8f7484e1a70e3d1d52c75f8bcf971448a3d44 /src/qml/qml/qqmlcompiler.cpp | |
parent | 76684fd3edcdc8e120c67f82cbd0625bf9bcc0bb (diff) |
Resolve member expressions of QObject members
...when the base is a QObject property itself or an ID referenced object.
This patch resolves for example the width property in a parent.width expression
to be a per-index lookup at run-time. That requires the base ("parent") however
to be a final property or come from an object where expected revision is known, i.e.
a QML imported object (scope or context).
Change-Id: Iaa1f57ace452da5e059c1d4e63b52b316e1a6b08
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler.cpp')
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 3f57d7c2ef..fc8570d128 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -3657,7 +3657,7 @@ bool QQmlCompiler::completeComponentBuild() const QString &sourceCode = jsEngine->code(); AST::UiProgram *qmlRoot = parser.qmlRoot(); - JSCodeGen jsCodeGen(unit->finalUrlString(), sourceCode, jsModule.data(), jsEngine, qmlRoot, output->importCache); + JSCodeGen jsCodeGen(enginePrivate, unit->finalUrlString(), sourceCode, jsModule.data(), jsEngine, qmlRoot, output->importCache); JSCodeGen::ObjectIdMapping idMapping; if (compileState->ids.count() > 0) { @@ -3666,6 +3666,7 @@ bool QQmlCompiler::completeComponentBuild() JSCodeGen::IdMapping m; m.name = o->id; m.idIndex = o->idIndex; + m.type = o->metatype; idMapping << m; } } |