aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompiler_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-15 16:17:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-17 08:10:07 +0100
commit814504306df0b76da1654a74524bdc353527d06f (patch)
treed20bd388b6992e2e36c66f809070428235e7522b /src/qml/qml/qqmlcompiler_p.h
parent8fc545de4166eb3c73833e9d9136dfbebf43539a (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/qqmlcompiler_p.h')
-rw-r--r--src/qml/qml/qqmlcompiler_p.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h
index c94cee16cf..788def0288 100644
--- a/src/qml/qml/qqmlcompiler_p.h
+++ b/src/qml/qml/qqmlcompiler_p.h
@@ -65,6 +65,7 @@
#include <private/qqmlcodegenerator_p.h>
#include "private/qv4identifier_p.h"
#include <private/qqmljsastfwd_p.h>
+#include "qqmlcustomparser_p.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qset.h>
@@ -332,7 +333,7 @@ namespace QQmlCompilerTypes {
};
class QMetaObjectBuilder;
-class Q_AUTOTEST_EXPORT QQmlCompiler
+class Q_AUTOTEST_EXPORT QQmlCompiler : public QQmlCustomParserCompilerBackend
{
Q_DECLARE_TR_FUNCTIONS(QQmlCompiler)
public:
@@ -348,9 +349,10 @@ public:
static bool isAttachedPropertyName(const QHashedStringRef &);
static bool isSignalPropertyName(const QHashedStringRef &);
- int evaluateEnum(const QHashedStringRef &scope, const QByteArray& enumValue, bool *ok) const; // for QQmlCustomParser::evaluateEnum
- const QMetaObject *resolveType(const QString& name) const; // for QQmlCustomParser::resolveType
int bindingIdentifier(const QString &name, const QQmlScript::Variant& value, const QQmlCompilerTypes::BindingContext &ctxt); // for QQmlCustomParser::bindingIndex
+ virtual QQmlBinding::Identifier bindingIdentifier(const QQmlScript::Variant&value, const QString&name, QQmlCustomParser *customParser);
+
+ virtual const QQmlImports &imports() const { return unit->imports(); }
private:
typedef QQmlCompiledData::Instruction Instruction;