summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qmldom.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp
index 54cc2e4..bd4d987 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qmldom.cpp
@@ -152,6 +152,12 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data)
{
d->error = QString();
+ QmlXmlParser parser;
+ if(!parser.parse(data)) {
+ d->error = parser.errorDescription();
+ return false;
+ }
+
QmlCompiledComponent component;
QmlCompiler compiler;
// ###
@@ -162,15 +168,16 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data)
return false;
}
- if(tree) {
- component.dump(0, tree);
- d->root = tree;
+ if(parser.tree()) {
+ component.dump(0, parser.tree());
+ d->root = parser.tree();
d->root->addref();
}
return true;
}
+
/*!
Returns the last load error. The load error will be reset after a
successful call to load().