aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-07 15:59:24 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-10 10:26:39 +0100
commitb681bd3e4ad20eb558da68ba1a2e2dfddfab9cf1 (patch)
treeb2ff2bdc1ec91fb332c405466e9a6e29d7d40c3c /src/qml/qml/qqmlobjectcreator_p.h
parentc96a5432f9d34925c55753d592842a3bf7172cf2 (diff)
[new compiler] Cleanups
Tie QQmlCompilePass and QQmlTypeCompiler together, so that we can eliminate the battery of parameters to the individual compiler phases. Change-Id: If2b6cf8416e6c2253c8f054048d1fd5ae12282b6 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.h44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index 796d92a1e6..92f40648d3 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -45,34 +45,19 @@
#include <private/qqmltypenamecache_p.h>
#include <private/qv4compileddata_p.h>
#include <private/qqmlcompiler_p.h>
+#include <private/qqmltypecompiler_p.h>
#include <QLinkedList>
QT_BEGIN_NAMESPACE
class QQmlAbstractBinding;
-
-struct QQmlCompilePass
-{
- QQmlCompilePass(const QUrl &url, const QV4::CompiledData::QmlUnit *unit);
- QQmlCompilePass(const QUrl &url, const QStringList &stringTable);
- QList<QQmlError> errors;
-
- 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::Unit *jsUnit;
- const QStringList stringTable;
-};
+struct QQmlTypeCompiler;
class QQmlPropertyCacheCreator : public QQmlCompilePass
{
Q_DECLARE_TR_FUNCTIONS(QQmlPropertyCacheCreator)
public:
- QQmlPropertyCacheCreator(QQmlEnginePrivate *enginePrivate, const QStringList &stringTable,
- const QUrl &url, const QQmlImports *imports,
- QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes);
+ QQmlPropertyCacheCreator(QQmlTypeCompiler *typeCompiler);
bool create(const QtQml::QmlObject *obj, QQmlPropertyCache **cache, QByteArray *vmeMetaObjectData);
@@ -86,14 +71,7 @@ class QQmlComponentAndAliasResolver : public QQmlCompilePass
{
Q_DECLARE_TR_FUNCTIONS(QQmlAnonymousComponentResolver)
public:
- 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);
+ QQmlComponentAndAliasResolver(QQmlTypeCompiler *typeCompiler);
bool resolve();
@@ -126,11 +104,7 @@ class QQmlPropertyValidator : public QQmlCompilePass
{
Q_DECLARE_TR_FUNCTIONS(QQmlPropertyValidator)
public:
- QQmlPropertyValidator(const QUrl &url, const QV4::CompiledData::QmlUnit *qmlUnit,
- const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes,
- const QList<QQmlPropertyCache *> &propertyCaches,
- const QHash<int, QHash<int, int> > &objectIndexToIdPerComponent,
- QHash<int, QByteArray> *customParserData);
+ QQmlPropertyValidator(QQmlTypeCompiler *typeCompiler);
bool validate();
@@ -146,7 +120,7 @@ private:
QHash<int, QByteArray> *customParserData;
};
-class QmlObjectCreator : public QQmlCompilePass
+class QmlObjectCreator
{
Q_DECLARE_TR_FUNCTIONS(QmlObjectCreator)
public:
@@ -158,6 +132,8 @@ public:
QQmlComponentAttached *componentAttached;
QList<QQmlEnginePrivate::FinalizeCallback> finalizeCallbacks;
+ QList<QQmlError> errors;
+
private:
QObject *createInstance(int index, QObject *parent = 0);
@@ -169,6 +145,10 @@ private:
void setPropertyValue(QQmlPropertyData *property, const QV4::CompiledData::Binding *binding);
void setupFunctions();
+ QString stringAt(int idx) const { return qmlUnit->header.stringAt(idx); }
+ void recordError(const QV4::CompiledData::Location &location, const QString &description);
+
+ QUrl url;
QQmlEngine *engine;
const QV4::CompiledData::QmlUnit *qmlUnit;
const QV4::CompiledData::CompilationUnit *jsUnit;