summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-06-24 04:26:22 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-06-24 04:26:22 (GMT)
commite747c27200930f111467f29c482d28ea0eccf7e0 (patch)
treef56b19761a236559758231d52744f4d75a71c59e /src/declarative
parent6d7120dc2081e10c46ffe8467b047affe81ed747 (diff)
downloadQt-e747c27200930f111467f29c482d28ea0eccf7e0.zip
Qt-e747c27200930f111467f29c482d28ea0eccf7e0.tar.gz
Qt-e747c27200930f111467f29c482d28ea0eccf7e0.tar.bz2
Display errors in component creation in setQml()
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxitem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 0c4d97b..73786a8 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -897,7 +897,16 @@ void QFxItem::qmlLoaded()
QmlContext *ctxt = new QmlContext(qmlContext(this));
ctxt->addDefaultObject(this);
+ if (!d->_qmlcomp->errors().isEmpty()) {
+ qWarning() << d->_qmlcomp->errors();
+ delete d->_qmlcomp;
+ d->_qmlcomp = 0;
+ emit qmlChanged();
+ return;
+ }
QObject *obj = d->_qmlcomp->create(ctxt);
+ if (!d->_qmlcomp->errors().isEmpty())
+ qWarning() << d->_qmlcomp->errors();
QFxItem *qmlChild = qobject_cast<QFxItem *>(obj);
if (qmlChild) {
qmlChild->setItemParent(this);