diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-09-10 00:19:33 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-09-10 00:19:33 (GMT) |
commit | a250db23c96fc1ec47ea4d19d62a19cad7c50b46 (patch) | |
tree | 640237f325d4a734ecc42c042812a497c7a1f190 /src/declarative/qml/qmlcustomparser_p.h | |
parent | d3bd0567fbc16263fcb181d58529e6d7aeee1bbd (diff) | |
download | Qt-a250db23c96fc1ec47ea4d19d62a19cad7c50b46.zip Qt-a250db23c96fc1ec47ea4d19d62a19cad7c50b46.tar.gz Qt-a250db23c96fc1ec47ea4d19d62a19cad7c50b46.tar.bz2 |
Report custom parse errors verbosely.
Diffstat (limited to 'src/declarative/qml/qmlcustomparser_p.h')
-rw-r--r-- | src/declarative/qml/qmlcustomparser_p.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qmlcustomparser_p.h index 74bd15c..5be0680 100644 --- a/src/declarative/qml/qmlcustomparser_p.h +++ b/src/declarative/qml/qmlcustomparser_p.h @@ -57,6 +57,8 @@ #include <QtCore/qxmlstream.h> #include <QtDeclarative/qfxglobal.h> #include <QtDeclarative/qmlmetatype.h> +#include <QtDeclarative/qmlerror.h> +#include <private/qmlparser_p.h> QT_BEGIN_HEADER @@ -74,6 +76,7 @@ public: ~QmlCustomParserProperty(); QByteArray name() const; + QmlParser::Location location() const; bool isList() const; // Will be one of QmlParser::Variant, QmlCustomParserProperty or @@ -96,6 +99,7 @@ public: ~QmlCustomParserNode(); QByteArray name() const; + QmlParser::Location location() const; QList<QmlCustomParserProperty> properties() const; @@ -109,8 +113,19 @@ class Q_DECLARATIVE_EXPORT QmlCustomParser public: virtual ~QmlCustomParser() {} - virtual QByteArray compile(const QList<QmlCustomParserProperty> &, bool *ok); - virtual void setCustomData(QObject *, const QByteArray &); + void clearErrors(); + + virtual QByteArray compile(const QList<QmlCustomParserProperty> &)=0; + virtual void setCustomData(QObject *, const QByteArray &)=0; + + QList<QmlError> errors() const { return exceptions; } + +protected: + void error(const QmlCustomParserProperty&, const QString& description); + void error(const QmlCustomParserNode&, const QString& description); + +private: + QList<QmlError> exceptions; }; #define QML_DEFINE_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, NAME, TYPE, CUSTOMTYPE) \ template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *,(VERSION_MAJ), (VERSION_MIN_FROM), (VERSION_MAJ_TO)>::instance(qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, #NAME, #TYPE, new CUSTOMTYPE)); |