aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-05-07 13:33:24 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:12 +0200
commit33593f00e84e6fb05191e9bb88000566c0c96426 (patch)
tree127877f1719689659a8ec6cea669ad5d38ec0903 /src/quick
parent9afc7d9a53ad86e548e2d239ff012bed15eb52ba (diff)
Get rid of StringRef
Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp7
-rw-r--r--src/quick/items/qquickitem.cpp24
-rw-r--r--src/quick/util/qquickglobal.cpp22
3 files changed, 26 insertions, 27 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 9636523ff0..059123e600 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -1748,7 +1748,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon
if (QV4::Object *o = ctx->d()->callData->args[0].asObject()) {
QV4::ScopedString s(scope, scope.engine->newString(QStringLiteral("data")));
- QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, o->get(s));
+ QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, o->get(s.getPointer()));
if (!!pixelData) {
patternTexture = pixelData->d()->image;
}
@@ -2859,7 +2859,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_measureText(QV4::CallConte
QFontMetrics fm(r->d()->context->state.font);
uint width = fm.width(ctx->d()->callData->args[0].toQStringNoThrow());
QV4::Scoped<QV4::Object> tm(scope, scope.engine->newObject());
- tm->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("width"))),
+ tm->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("width"))).getPointer(),
QV4::ScopedValue(scope, QV4::Primitive::fromDouble(width)));
return tm.asReturnedValue();
}
@@ -4198,8 +4198,7 @@ QQuickContext2DEngineData::QQuickContext2DEngineData(QV8Engine *engine)
gradientProto = proto;
proto = scope.engine->newObject();
- QV4::ScopedString s(scope, scope.engine->id_length);
- proto->defineAccessorProperty(s, QQuickJSContext2DPixelData::proto_get_length, 0);
+ proto->defineAccessorProperty(scope.engine->id_length, QQuickJSContext2DPixelData::proto_get_length, 0);
pixelArrayProto = proto;
}
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 73047add5d..51bec66d22 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -4002,15 +4002,15 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const
QRectF r = mapRectFromItem(itemObj, QRectF(x, y, w, h));
- rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(r.x())));
- rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(r.y())));
- rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Primitive::fromDouble(r.width())));
- rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Primitive::fromDouble(r.height())));
+ rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(r.x())));
+ rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(r.y())));
+ rv->put((s = v4->newString(QStringLiteral("width"))).getPointer(), (v = QV4::Primitive::fromDouble(r.width())));
+ rv->put((s = v4->newString(QStringLiteral("height"))).getPointer(), (v = QV4::Primitive::fromDouble(r.height())));
} else {
QPointF p = mapFromItem(itemObj, QPointF(x, y));
- rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(p.x())));
- rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(p.y())));
+ rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(p.x())));
+ rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(p.y())));
}
}
}
@@ -4082,15 +4082,15 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const
QRectF r = mapRectToItem(itemObj, QRectF(x, y, w, h));
- rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(r.x())));
- rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(r.y())));
- rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Primitive::fromDouble(r.width())));
- rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Primitive::fromDouble(r.height())));
+ rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(r.x())));
+ rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(r.y())));
+ rv->put((s = v4->newString(QStringLiteral("width"))).getPointer(), (v = QV4::Primitive::fromDouble(r.width())));
+ rv->put((s = v4->newString(QStringLiteral("height"))).getPointer(), (v = QV4::Primitive::fromDouble(r.height())));
} else {
QPointF p = mapToItem(itemObj, QPointF(x, y));
- rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(p.x())));
- rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(p.y())));
+ rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(p.x())));
+ rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(p.y())));
}
}
}
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 4428452aa0..b92613a718 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -286,17 +286,17 @@ public:
QV4::ScopedString s(scope);
- QV4::ScopedValue vbold(scope, obj->get((s = v4->newString(QStringLiteral("bold")))));
- QV4::ScopedValue vcap(scope, obj->get((s = v4->newString(QStringLiteral("capitalization")))));
- QV4::ScopedValue vfam(scope, obj->get((s = v4->newString(QStringLiteral("family")))));
- QV4::ScopedValue vital(scope, obj->get((s = v4->newString(QStringLiteral("italic")))));
- QV4::ScopedValue vlspac(scope, obj->get((s = v4->newString(QStringLiteral("letterSpacing")))));
- QV4::ScopedValue vpixsz(scope, obj->get((s = v4->newString(QStringLiteral("pixelSize")))));
- QV4::ScopedValue vpntsz(scope, obj->get((s = v4->newString(QStringLiteral("pointSize")))));
- QV4::ScopedValue vstrk(scope, obj->get((s = v4->newString(QStringLiteral("strikeout")))));
- QV4::ScopedValue vundl(scope, obj->get((s = v4->newString(QStringLiteral("underline")))));
- QV4::ScopedValue vweight(scope, obj->get((s = v4->newString(QStringLiteral("weight")))));
- QV4::ScopedValue vwspac(scope, obj->get((s = v4->newString(QStringLiteral("wordSpacing")))));
+ QV4::ScopedValue vbold(scope, obj->get((s = v4->newString(QStringLiteral("bold"))).getPointer()));
+ QV4::ScopedValue vcap(scope, obj->get((s = v4->newString(QStringLiteral("capitalization"))).getPointer()));
+ QV4::ScopedValue vfam(scope, obj->get((s = v4->newString(QStringLiteral("family"))).getPointer()));
+ QV4::ScopedValue vital(scope, obj->get((s = v4->newString(QStringLiteral("italic"))).getPointer()));
+ QV4::ScopedValue vlspac(scope, obj->get((s = v4->newString(QStringLiteral("letterSpacing"))).getPointer()));
+ QV4::ScopedValue vpixsz(scope, obj->get((s = v4->newString(QStringLiteral("pixelSize"))).getPointer()));
+ QV4::ScopedValue vpntsz(scope, obj->get((s = v4->newString(QStringLiteral("pointSize"))).getPointer()));
+ QV4::ScopedValue vstrk(scope, obj->get((s = v4->newString(QStringLiteral("strikeout"))).getPointer()));
+ QV4::ScopedValue vundl(scope, obj->get((s = v4->newString(QStringLiteral("underline"))).getPointer()));
+ QV4::ScopedValue vweight(scope, obj->get((s = v4->newString(QStringLiteral("weight"))).getPointer()));
+ QV4::ScopedValue vwspac(scope, obj->get((s = v4->newString(QStringLiteral("wordSpacing"))).getPointer()));
// pull out the values, set ok to true if at least one valid field is given.
if (vbold->isBoolean()) {