aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-12-12 16:23:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-09 10:33:00 +0100
commit36a4cc1830d4179f327e3b5700794514f3f56e06 (patch)
tree2534ff7bfef062fd0e7fce48a5cd987a23c9222b /src/qml/qml/qqmlobjectcreator_p.h
parente2c2fcd1d18990d7d1b7286fc8f2b9f8269691e2 (diff)
[new compiler] Move component determination and alias resolving
Move the code before the JS code generation, as we are going to need the component boundaries for the correct scoping. This requires the component and alias resolver to operate on the pre-compiled-data data structures. Change-Id: I8d2e697d8a05e5a4914db93e785704f6b2434a2e 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.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index d395f0238f..796d92a1e6 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -57,12 +57,12 @@ struct QQmlCompilePass
QQmlCompilePass(const QUrl &url, const QStringList &stringTable);
QList<QQmlError> errors;
- QString stringAt(int idx) const { return qmlUnit ? qmlUnit->header.stringAt(idx): stringTable.at(idx); }
+ QString stringAt(int idx) const { return jsUnit ? jsUnit->stringAt(idx): stringTable.at(idx); }
protected:
void recordError(const QV4::CompiledData::Location &location, const QString &description);
const QUrl url;
- const QV4::CompiledData::QmlUnit *qmlUnit;
+ const QV4::CompiledData::Unit *jsUnit;
const QStringList stringTable;
};
@@ -86,12 +86,14 @@ class QQmlComponentAndAliasResolver : public QQmlCompilePass
{
Q_DECLARE_TR_FUNCTIONS(QQmlAnonymousComponentResolver)
public:
- QQmlComponentAndAliasResolver(const QUrl &url, const QV4::CompiledData::QmlUnit *qmlUnit,
- const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes,
- const QList<QQmlPropertyCache *> &propertyCaches,
- QList<QByteArray> *vmeMetaObjectData,
- QHash<int, int> *objectIndexToIdForRoot,
- QHash<int, QHash<int, int> > *objectIndexToIdPerComponent);
+ QQmlComponentAndAliasResolver(const QUrl &url, const QStringList &stringTable,
+ const QList<QtQml::QmlObject*> &qmlObjects,
+ int indexOfRootObject,
+ const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes,
+ const QList<QQmlPropertyCache *> &propertyCaches,
+ QList<QByteArray> *vmeMetaObjectData,
+ QHash<int, int> *objectIndexToIdForRoot,
+ QHash<int, QHash<int, int> > *objectIndexToIdPerComponent);
bool resolve();
@@ -102,6 +104,9 @@ protected:
bool isComponentType(int typeNameIndex) const
{ return resolvedTypes.value(typeNameIndex).type == 0; }
+ const QList<QtQml::QmlObject*> &qmlObjects;
+ const int indexOfRootObject;
+
// indices of objects that are of type QQmlComponent
QVector<int> componentBoundaries;
@@ -134,6 +139,7 @@ private:
bool isComponent(int objectIndex) const { return objectIndexToIdPerComponent.contains(objectIndex); }
+ const QV4::CompiledData::QmlUnit *qmlUnit;
const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes;
const QList<QQmlPropertyCache *> &propertyCaches;
const QHash<int, QHash<int, int> > objectIndexToIdPerComponent;
@@ -164,6 +170,7 @@ private:
void setupFunctions();
QQmlEngine *engine;
+ const QV4::CompiledData::QmlUnit *qmlUnit;
const QV4::CompiledData::CompilationUnit *jsUnit;
QQmlContextData *parentContext;
QQmlContextData *context;