diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-15 16:17:22 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-17 08:10:07 +0100 |
commit | 814504306df0b76da1654a74524bdc353527d06f (patch) | |
tree | d20bd388b6992e2e36c66f809070428235e7522b /src/qml/qml/qqmlcustomparser_p.h | |
parent | 8fc545de4166eb3c73833e9d9136dfbebf43539a (diff) |
[new compiler] Add support for type and enum resolution for custom parsers
This is in preparation for listmodel support, share the code for resolving
types and enums between the old and the new compiler, as all it needs is the
imports.
Change-Id: I4908d71eee50c769108e0e2b68b03496722fa49d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcustomparser_p.h')
-rw-r--r-- | src/qml/qml/qqmlcustomparser_p.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcustomparser_p.h b/src/qml/qml/qqmlcustomparser_p.h index 39afa2a28e..2f1a9ddec8 100644 --- a/src/qml/qml/qqmlcustomparser_p.h +++ b/src/qml/qml/qqmlcustomparser_p.h @@ -108,6 +108,17 @@ private: QQmlCustomParserNodePrivate *d; }; +struct QQmlCustomParserCompilerBackend +{ + virtual ~QQmlCustomParserCompilerBackend() {} + virtual const QQmlImports &imports() const = 0; + + int evaluateEnum(const QString &scope, const QByteArray& enumValue, bool *ok) const; + const QMetaObject *resolveType(const QString& name) const; + + virtual QQmlBinding::Identifier bindingIdentifier(const QQmlScript::Variant&, const QString&, QQmlCustomParser *) { return QQmlBinding::Invalid; } +}; + class Q_QML_PRIVATE_EXPORT QQmlCustomParser { public: @@ -146,10 +157,11 @@ protected: private: QList<QQmlError> exceptions; - QQmlCompiler *compiler; + QQmlCustomParserCompilerBackend *compiler; QQmlScript::Object *object; Flags m_flags; friend class QQmlCompiler; + friend class QQmlPropertyValidator; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QQmlCustomParser::Flags) |