diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-15 16:49:25 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-17 04:03:33 +0000 |
commit | 8c10d12be1a219a6bd5bd54499b281551c79c823 (patch) | |
tree | e029905ef0f394b91d7a2512492bc183c45fcd5e /src/qml/qml | |
parent | b75988f57498436e1e4417324172f73cb0fc3b80 (diff) |
Remove remaining dependency of QQmlPropertyValidator on QQmlTypeCompiler
Instead we can get most of the data from QV4::CompilationUnit - which
is always ready at that point in time. And errors are now returned
explicitly in the API.
Change-Id: I6acbeb550661f88f7fad09e97f78a1a4cbd77568
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlcustomparser.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlcustomparser_p.h | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlcustomparser.cpp b/src/qml/qml/qqmlcustomparser.cpp index 30eed4d551..85c91a592a 100644 --- a/src/qml/qml/qqmlcustomparser.cpp +++ b/src/qml/qml/qqmlcustomparser.cpp @@ -100,11 +100,7 @@ void QQmlCustomParser::clearErrors() */ void QQmlCustomParser::error(const QV4::CompiledData::Location &location, const QString &description) { - QQmlError error; - error.setLine(location.line); - error.setColumn(location.column); - error.setDescription(description); - exceptions << error; + exceptions << QQmlCompileError(location, description); } struct StaticQtMetaObject : public QObject diff --git a/src/qml/qml/qqmlcustomparser_p.h b/src/qml/qml/qqmlcustomparser_p.h index d1ed61defe..5eb409990d 100644 --- a/src/qml/qml/qqmlcustomparser_p.h +++ b/src/qml/qml/qqmlcustomparser_p.h @@ -54,6 +54,7 @@ #include "qqmlmetatype_p.h" #include "qqmlerror.h" #include "qqmlbinding_p.h" +#include <private/qqmltypecompiler_p.h> #include <QtCore/qbytearray.h> #include <QtCore/qxmlstream.h> @@ -83,7 +84,7 @@ public: virtual void verifyBindings(const QV4::CompiledData::Unit *, const QList<const QV4::CompiledData::Binding *> &) = 0; virtual void applyBindings(QObject *, QV4::CompiledData::CompilationUnit *, const QList<const QV4::CompiledData::Binding *> &) = 0; - QList<QQmlError> errors() const { return exceptions; } + QVector<QQmlCompileError> errors() const { return exceptions; } protected: void error(const QV4::CompiledData::Binding *binding, const QString& description) @@ -97,7 +98,7 @@ protected: const QMetaObject *resolveType(const QString&) const; private: - QList<QQmlError> exceptions; + QVector<QQmlCompileError> exceptions; QQmlEnginePrivate *engine; const QQmlPropertyValidator *validator; Flags m_flags; |