aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-12 10:53:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-13 10:29:22 +0200
commit4b5a7b15fc6d3650c8e9b7bf619804a0a953eeba (patch)
treedc0e6952e2e6ee26118bcc14dc1f573fa9216593 /src/qml/qml/qqmlobjectcreator_p.h
parent8c2201e2e51e9a6c09b4f91c4b4fc09b2c82f4af (diff)
[new compiler] Implement proper type resolution
Collect all references to unknown types after parsing, re-use the existing code in QQmlTypeLoader to resolve them and finally use the resolved references map in the QQmlObjectCreator instead of the type name cache directly. Change-Id: I8b83af4f8852e79c33985457081c024358bb9622 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.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index 31d9d0d176..673809dd9b 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -44,6 +44,7 @@
#include <private/qqmlimport_p.h>
#include <private/qqmltypenamecache_p.h>
#include <private/qv4compileddata_p.h>
+#include <private/qqmlcompiler_p.h>
QT_BEGIN_NAMESPACE
@@ -54,7 +55,8 @@ class QQmlPropertyCacheCreator
Q_DECLARE_TR_FUNCTIONS(QQmlPropertyCacheCreator)
public:
QQmlPropertyCacheCreator(QQmlEnginePrivate *enginePrivate, const QV4::CompiledData::QmlUnit *unit,
- const QUrl &url, QQmlTypeNameCache *typeNameCache, const QQmlImports *imports);
+ const QUrl &url, const QQmlImports *imports,
+ QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes);
QList<QQmlError> errors;
@@ -67,8 +69,8 @@ protected:
QQmlEnginePrivate *enginePrivate;
const QV4::CompiledData::QmlUnit *unit;
QUrl url;
- QQmlTypeNameCache *typeNameCache;
const QQmlImports *imports;
+ QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes;
};
class QmlObjectCreator
@@ -76,7 +78,7 @@ class QmlObjectCreator
Q_DECLARE_TR_FUNCTIONS(QmlObjectCreator)
public:
QmlObjectCreator(QQmlContextData *contextData, const QV4::CompiledData::QmlUnit *qmlUnit, const QV4::CompiledData::CompilationUnit *jsUnit,
- QQmlTypeNameCache *typeNameCache, const QList<QQmlPropertyCache *> &propertyCaches, const QList<QByteArray> &vmeMetaObjectData);
+ const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes, const QList<QQmlPropertyCache *> &propertyCaches, const QList<QByteArray> &vmeMetaObjectData);
QObject *create(QObject *parent = 0)
{ return create(unit->indexOfRootObject, parent); }
@@ -102,7 +104,7 @@ private:
const QV4::CompiledData::QmlUnit *unit;
const QV4::CompiledData::CompilationUnit *jsUnit;
QQmlContextData *context;
- QQmlTypeNameCache *typeNameCache;
+ const QHash<int, QQmlCompiledData::TypeReference> resolvedTypes;
const QList<QQmlPropertyCache *> propertyCaches;
const QList<QByteArray> vmeMetaObjectData;