diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 12:24:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:24 +0200 |
commit | cf2a253f2f60c9f0c61682527d80143e72b355d4 (patch) | |
tree | d60e8be50437e6f15513e25155817b902a2062c7 /src/quick | |
parent | 7872b380063d0497ba62fecfdc92148f1ea947af (diff) |
Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of
QV4::Value that need fixing.
Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitem.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickitem.cpp | 24 | ||||
-rw-r--r-- | src/quick/items/qquickloader.cpp | 2 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 94fe95da4e..826feeb331 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -667,7 +667,7 @@ void QQuickCanvasItem::updatePolish() foreach (int key, animationCallbacks.keys()) { QV4::ScopedFunctionObject f(scope, animationCallbacks.value(key).value()); - callData->args[0] = QV4::Value::fromUInt32(QDateTime::currentDateTimeUtc().toTime_t()); + callData->args[0] = QV4::Primitive::fromUInt32(QDateTime::currentDateTimeUtc().toTime_t()); f->call(callData); } } diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 655632c662..263ee67398 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -2596,7 +2596,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_isPointInPath(QV4::SimpleC bool pointInPath = false; if (ctx->callData->argc == 2) pointInPath = r->context->isPointInPath(ctx->callData->args[0].toNumber(), ctx->callData->args[1].toNumber()); - return QV4::Value::fromBoolean(pointInPath).asReturnedValue(); + return QV4::Primitive::fromBoolean(pointInPath).asReturnedValue(); } QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawFocusRing(QV4::SimpleCallContext *ctx) @@ -2874,7 +2874,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_measureText(QV4::SimpleCal uint width = fm.width(ctx->callData->args[0].toQStringNoThrow()); QV4::Scoped<QV4::Object> tm(scope, ctx->engine->newObject()); tm->put(QV4::ScopedString(scope, ctx->engine->newIdentifier(QStringLiteral("width"))), - QV4::ScopedValue(scope, QV4::Value::fromDouble(width))); + QV4::ScopedValue(scope, QV4::Primitive::fromDouble(width))); return tm.asReturnedValue(); } return QV4::Encode::undefined(); diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index cd9e88e452..435f730fe1 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -3900,15 +3900,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::Value::fromDouble(r.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Value::fromDouble(r.y()))); - rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Value::fromDouble(r.width()))); - rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Value::fromDouble(r.height()))); + 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()))); } else { QPointF p = mapFromItem(itemObj, QPointF(x, y)); - rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Value::fromDouble(p.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Value::fromDouble(p.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()))); } } } @@ -3980,15 +3980,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::Value::fromDouble(r.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Value::fromDouble(r.y()))); - rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Value::fromDouble(r.width()))); - rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Value::fromDouble(r.height()))); + 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()))); } else { QPointF p = mapToItem(itemObj, QPointF(x, y)); - rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Value::fromDouble(p.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Value::fromDouble(p.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()))); } } } diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 1301225feb..a59c308354 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -940,7 +940,7 @@ QUrl QQuickLoaderPrivate::resolveSourceUrl(QQmlV4Function *args) QV4::Value QQuickLoaderPrivate::extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error) { QV4::Scope scope(args->v4engine()); - QV4::ScopedValue valuemap(scope, QV4::Value::undefinedValue()); + QV4::ScopedValue valuemap(scope, QV4::Primitive::undefinedValue()); if (args->length() >= 2) { QV4::ScopedValue v(scope, (*args)[1]); if (!v->isObject() || v->asArrayObject()) { |