summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2009-05-07 09:33:30 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2009-05-07 09:33:30 (GMT)
commit495150413916a9a41cdffc5879f36a6e16e7866c (patch)
treec390a023b505c4fef479580b89e17491657d6d8c /src/declarative
parent02b0285ba6c2382d801be8d9259f91d1bfbc94d7 (diff)
downloadQt-495150413916a9a41cdffc5879f36a6e16e7866c.zip
Qt-495150413916a9a41cdffc5879f36a6e16e7866c.tar.gz
Qt-495150413916a9a41cdffc5879f36a6e16e7866c.tar.bz2
Fix loading of components containing sub components through QmlDom
Pass a (optional) url to QmlDomDocument::load so that the compiler can find referenced components
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmldom.cpp5
-rw-r--r--src/declarative/qml/qmldom.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp
index 689446b..a31be81 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qmldom.cpp
@@ -149,16 +149,15 @@ int QmlDomDocument::version() const
\sa QmlDomDocument::save() QmlDomDocument::loadError()
*/
-bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data)
+bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl &url)
{
Q_UNUSED(engine);
-
d->errors.clear();
QmlCompiledComponent component;
QmlCompiler compiler;
- QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, QUrl());;
+ QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url);;
if(td->status == QmlCompositeTypeData::Error) {
d->errors = td->errors;
diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h
index daca888..f90fb08 100644
--- a/src/declarative/qml/qmldom.h
+++ b/src/declarative/qml/qmldom.h
@@ -73,7 +73,7 @@ public:
int version() const;
QList<QmlError> errors() const;
- bool load(QmlEngine *, const QByteArray &);
+ bool load(QmlEngine *, const QByteArray &, const QUrl & = QUrl());
QByteArray save() const;
QmlDomObject rootObject() const;