From 3123a22ae66016a0d9cd600dbb6f636fd29fc312 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 19 Sep 2013 13:32:13 +0200 Subject: [new compiler] Initial support for alias properties Aliases are resolved at "compile time", not rough JS expressions. This is done right after we determined the scope of components in the QML file, which is also where we collect object ids (that aliases use). Change-Id: If5702337f2cca08d17f196c3b2fde3bbdfea5b3c Reviewed-by: Lars Knoll --- src/qml/qml/qqmlobjectcreator_p.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/qml/qml/qqmlobjectcreator_p.h') diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index 4b29295f0a..fe3a4bb00a 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -80,13 +80,16 @@ protected: QHash *resolvedTypes; }; -class QQmlAnonymousComponentResolver : public QQmlCompilePass +class QQmlComponentAndAliasResolver : public QQmlCompilePass { Q_DECLARE_TR_FUNCTIONS(QQmlAnonymousComponentResolver) public: - QQmlAnonymousComponentResolver(const QUrl &url, const QV4::CompiledData::QmlUnit *qmlUnit, + QQmlComponentAndAliasResolver(const QUrl &url, const QV4::CompiledData::QmlUnit *qmlUnit, const QHash &resolvedTypes, - const QList &propertyCaches); + const QList &propertyCaches, + QList *vmeMetaObjectData, + QHash *objectIndexToIdForRoot, + QHash > *objectIndexToIdPerComponent); bool resolve(); @@ -94,13 +97,19 @@ public: QHash objectIndexToComponentIndex; protected: - bool recordComponentSubTree(int objectIndex); + bool collectIdsAndAliases(int objectIndex); + bool resolveAliases(); int _componentIndex; - QSet _ids; + QHash _idToObjectIndex; + QHash *_objectIndexToIdInScope; + QList _objectsWithAliases; const QHash resolvedTypes; const QList propertyCaches; + QList *vmeMetaObjectData; + QHash *objectIndexToIdForRoot; + QHash > *objectIndexToIdPerComponent; }; class QmlObjectCreator : public QQmlCompilePass -- cgit v1.2.3