aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-18 15:34:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commit700ba1bcb39e082049c96fafdfaccfe5d83cd77e (patch)
treed21da27b94a927377ba2c6efd7c3af731d890b19 /src/quick/items
parent1aa618970a9bed46123d0648500e957688d725ec (diff)
Use a StringRef for Managed::get()
also store "toString" and "valueOf" as identifiers in the engine and fix two places where we compared strings the wrong way. Change-Id: I70612221e72d43ed0e3c496e4209681bf254cded Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index f84a6855dd..1dd4e950c6 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -1720,7 +1720,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::SimpleC
QV8Engine *engine = ctx->engine->v8Engine;
if (ctx->argumentCount == 2) {
- QQuickContext2DStyle *pattern = new (v4->memoryManager) QQuickContext2DStyle(v4);
+ QV4::Scoped<QQuickContext2DStyle> pattern(scope, new (v4->memoryManager) QQuickContext2DStyle(v4));
QColor color = engine->toVariant(ctx->arguments[0], qMetaTypeId<QColor>()).value<QColor>();
if (color.isValid()) {
@@ -1734,7 +1734,8 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::SimpleC
QImage patternTexture;
if (QV4::Object *o = ctx->arguments[0].asObject()) {
- QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, o->get(ctx->engine->newString(QStringLiteral("data"))));
+ QV4::ScopedString s(scope, ctx->engine->newString(QStringLiteral("data")));
+ QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, o->get(s));
if (!!pixelData) {
patternTexture = pixelData->image;
}
@@ -1763,7 +1764,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::SimpleC
}
}
- return QV4::Value::fromObject(pattern).asReturnedValue();
+ return pattern.asReturnedValue();
}
return QV4::Encode::undefined();