diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-04-15 01:56:39 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-04-15 01:56:39 (GMT) |
commit | 0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b (patch) | |
tree | 8ca8fc8ec356da66026d1317f53a4dc570d2b621 /src/declarative/util/qdeclarativestateoperations.cpp | |
parent | 9b04182107e35cd1cb924d2e98a9d099b3f8a1c5 (diff) | |
download | Qt-0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b.zip Qt-0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b.tar.gz Qt-0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b.tar.bz2 |
Output script errors in ScriptAction and StateChangeScript
Task-number: QTBUG-9897
Diffstat (limited to 'src/declarative/util/qdeclarativestateoperations.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativestateoperations.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 410a269..0521d27 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -49,6 +49,7 @@ #include <qdeclarativeitem_p.h> #include <qdeclarativeguard_p.h> #include <qdeclarativenullablevalue_p_p.h> +#include "private/qdeclarativecontext_p.h" #include <QtCore/qdebug.h> #include <QtGui/qgraphicsitem.h> @@ -571,7 +572,12 @@ void QDeclarativeStateChangeScript::execute() const QString &script = d->script.script(); if (!script.isEmpty()) { QDeclarativeExpression expr(d->script.context(), script, d->script.scopeObject()); + QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(this); + if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) + expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); expr.value(); + if (expr.hasError()) + qWarning() << expr.error(); } } |