aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-19 13:32:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 14:27:49 +0200
commit3123a22ae66016a0d9cd600dbb6f636fd29fc312 (patch)
treede483a714d4ac3234de4b13e3c6bb00d437d0a32 /src/qml/qml/qqmlobjectcreator_p.h
parent4c953b1592956b712eca60eec070868a567c04c1 (diff)
[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 <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator_p.h')
-rw-r--r--src/qml/qml/qqmlobjectcreator_p.h19
1 files changed, 14 insertions, 5 deletions
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<int, QQmlCompiledData::TypeReference> *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<int, QQmlCompiledData::TypeReference> &resolvedTypes,
- const QList<QQmlPropertyCache *> &propertyCaches);
+ const QList<QQmlPropertyCache *> &propertyCaches,
+ QList<QByteArray> *vmeMetaObjectData,
+ QHash<int, int> *objectIndexToIdForRoot,
+ QHash<int, QHash<int, int> > *objectIndexToIdPerComponent);
bool resolve();
@@ -94,13 +97,19 @@ public:
QHash<int, int> objectIndexToComponentIndex;
protected:
- bool recordComponentSubTree(int objectIndex);
+ bool collectIdsAndAliases(int objectIndex);
+ bool resolveAliases();
int _componentIndex;
- QSet<int> _ids;
+ QHash<int, int> _idToObjectIndex;
+ QHash<int, int> *_objectIndexToIdInScope;
+ QList<int> _objectsWithAliases;
const QHash<int, QQmlCompiledData::TypeReference> resolvedTypes;
const QList<QQmlPropertyCache *> propertyCaches;
+ QList<QByteArray> *vmeMetaObjectData;
+ QHash<int, int> *objectIndexToIdForRoot;
+ QHash<int, QHash<int, int> > *objectIndexToIdPerComponent;
};
class QmlObjectCreator : public QQmlCompilePass