diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 7 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativestateoperations.cpp | 6 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index b65212b..3a35dd5 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -677,7 +677,7 @@ void QDeclarativeTextPrivate::updateSize() QTextOption option((Qt::Alignment)int(hAlign | vAlign)); option.setWrapMode(QTextOption::WrapMode(wrapMode)); doc->setDefaultTextOption(option); - if (wrapMode != QDeclarativeText::NoWrap && !q->heightValid() && q->widthValid()) + if (wrapMode != QDeclarativeText::NoWrap && q->widthValid()) doc->setTextWidth(q->width()); else doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 33ddb46..fac38d7 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -44,6 +44,7 @@ #include "private/qdeclarativebehavior_p.h" #include "private/qdeclarativestateoperations_p.h" +#include "private/qdeclarativecontext_p.h" #include <qdeclarativepropertyvaluesource.h> #include <qdeclarative.h> @@ -767,6 +768,7 @@ void QDeclarativeScriptAction::setStateChangeScriptName(const QString &name) void QDeclarativeScriptActionPrivate::execute() { + Q_Q(QDeclarativeScriptAction); if (hasRunScriptScript && reversing) return; @@ -775,7 +777,12 @@ void QDeclarativeScriptActionPrivate::execute() const QString &str = scriptStr.script(); if (!str.isEmpty()) { QDeclarativeExpression expr(scriptStr.context(), str, scriptStr.scopeObject()); + QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(q); + if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) + expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); expr.value(); + if (expr.hasError()) + qWarning() << expr.error(); } } 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(); } } |