diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-28 16:49:51 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-02 20:52:57 +0100 |
commit | 1e6f2fc90ddf0026f2ae757ad4233974b99b85ab (patch) | |
tree | 2c972a7114e1e30091412138db2842a1f37b0760 /src/qml/compiler/qqmltypecompiler_p.h | |
parent | 735cbe15c20f3a3fde23987b0e1a596d64324f20 (diff) |
[new compiler] Cleanup
Move SignalHandlerConverter into the type compiler and make it a proper
compile pass sub-class.
Change-Id: Ice8fc9acdfdb613e1d7b25728401a2376a692ccc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler_p.h')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler_p.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h index d574291869..775b1f6127 100644 --- a/src/qml/compiler/qqmltypecompiler_p.h +++ b/src/qml/compiler/qqmltypecompiler_p.h @@ -94,6 +94,8 @@ public: QHash<int, QHash<int, int> > *objectIndexToIdPerComponent(); QHash<int, QQmlCompiledData::CustomParserData> *customParserData(); QQmlJS::MemoryPool *memoryPool(); + QStringRef newStringRef(const QString &string); + const QStringList &stringPool() const; void setCustomParserBindings(const QVector<int> &bindings); private: @@ -138,6 +140,27 @@ protected: QVector<QQmlPropertyCache*> propertyCaches; }; +// "Converts" signal expressions to full-fleged function declarations with +// parameters taken from the signal declarations +// It also updates the QV4::CompiledData::Binding objects to set the property name +// to the final signal name (onTextChanged -> textChanged) and sets the IsSignalExpression flag. +struct SignalHandlerConverter : public QQmlCompilePass +{ + Q_DECLARE_TR_FUNCTIONS(QQmlCodeGenerator) +public: + SignalHandlerConverter(QQmlTypeCompiler *typeCompiler); + + bool convertSignalHandlerExpressionsToFunctionDeclarations(); + +private: + bool convertSignalHandlerExpressionsToFunctionDeclarations(const QmlObject *obj, const QString &typeName, QQmlPropertyCache *propertyCache); + + const QList<QtQml::QmlObject*> &qmlObjects; + const QHash<int, QQmlCompiledData::TypeReference*> &resolvedTypes; + const QSet<QString> &illegalNames; + const QVector<QQmlPropertyCache*> &propertyCaches; +}; + // ### This will go away when the codegen resolves all enums to constant expressions // and we replace the constant expression with a literal binding instead of using // a script. |