aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-13 10:57:54 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-13 17:24:46 +0000
commit56cf625ad3cf86c4417acf463c4bfb369c7f0916 (patch)
tree5e8c2e6ca48d9b4b70d15097be09059bdde6f1ce /src
parent1e3df38bcb61054d53b0853fa2648aae87f1044b (diff)
QQuickItem: eliminate repeated access to QQmlV4Function::v4engine()
Change-Id: Ifc33c17d125ca794a157a87dc5cc1be51c2aaefb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickitem.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index fe4d84b334..f371138ea3 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -4363,12 +4363,12 @@ void QQuickItem::polish()
*/
void QQuickItem::mapFromItem(QQmlV4Function *args) const
{
+ QV4::ExecutionEngine *v4 = args->v4engine();
if (args->length() != 3 && args->length() != 5) {
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
- QV4::ExecutionEngine *v4 = args->v4engine();
QV4::Scope scope(v4);
QV4::ScopedValue item(scope, (*args)[0]);
@@ -4382,7 +4382,7 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const
if (!itemObj && !item->isNull()) {
qmlInfo(this) << "mapFromItem() given argument \"" << item->toQStringNoThrow()
<< "\" which is neither null nor an Item";
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
@@ -4390,7 +4390,7 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const
QV4::ScopedValue vy(scope, (*args)[2]);
if (!vx->isNumber() || !vy->isNumber()) {
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
@@ -4403,7 +4403,7 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const
QV4::ScopedValue vw(scope, (*args)[3]);
QV4::ScopedValue vh(scope, (*args)[4]);
if (!vw->isNumber() || !vh->isNumber()) {
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
qreal w = vw->asDouble();
@@ -4451,12 +4451,12 @@ QTransform QQuickItem::itemTransform(QQuickItem *other, bool *ok) const
*/
void QQuickItem::mapToItem(QQmlV4Function *args) const
{
+ QV4::ExecutionEngine *v4 = args->v4engine();
if (args->length() != 3 && args->length() != 5) {
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
- QV4::ExecutionEngine *v4 = args->v4engine();
QV4::Scope scope(v4);
QV4::ScopedValue item(scope, (*args)[0]);
@@ -4470,7 +4470,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const
if (!itemObj && !item->isNull()) {
qmlInfo(this) << "mapToItem() given argument \"" << item->toQStringNoThrow()
<< "\" which is neither null nor an Item";
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
@@ -4478,7 +4478,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const
QV4::ScopedValue vy(scope, (*args)[2]);
if (!vx->isNumber() || !vy->isNumber()) {
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
@@ -4491,7 +4491,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const
QV4::ScopedValue vw(scope, (*args)[3]);
QV4::ScopedValue vh(scope, (*args)[4]);
if (!vw->isNumber() || !vh->isNumber()) {
- args->v4engine()->throwTypeError();
+ v4->throwTypeError();
return;
}
qreal w = vw->asDouble();