summaryrefslogtreecommitdiffstats
path: root/src/imports/location/qdeclarativepolygonmapitem.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-09-19 12:12:22 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 16:21:40 +0200
commitdeccc5f146c38d5bafe4b608c30a28602ef20f6d (patch)
tree1041201d811c33c4d12d179bf586a4212fa01bfe /src/imports/location/qdeclarativepolygonmapitem.cpp
parente0256ec27512437421d8a63d9090e478b87af599 (diff)
Make compile after recent V4 API changes
Change-Id: Ib14d670e51c256d52ad6c62a6091b470ed3c95e7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/imports/location/qdeclarativepolygonmapitem.cpp')
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp
index b1e43397..bd67a82a 100644
--- a/src/imports/location/qdeclarativepolygonmapitem.cpp
+++ b/src/imports/location/qdeclarativepolygonmapitem.cpp
@@ -390,17 +390,18 @@ QJSValue QDeclarativePolygonMapItem::path() const
QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(engine);
QV4::ExecutionEngine *v4 = QV8Engine::getV4(v8Engine);
- QV4::ArrayObject *pathArray = v4->newArrayObject(path_.length());
+ QV4::Scope scope(v4);
+ QV4::Scoped<QV4::ArrayObject> pathArray(scope, v4->newArrayObject(path_.length()));
for (int i = 0; i < path_.length(); ++i) {
const QGeoCoordinate &c = path_.at(i);
QQmlValueType *vt = QQmlValueTypeFactory::valueType(qMetaTypeId<QGeoCoordinate>());
- QV4::Value cv = QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt);
+ QV4::ScopedValue cv(scope, QV4::QmlValueTypeWrapper::create(v8Engine, QVariant::fromValue(c), vt));
pathArray->putIndexed(i, cv);
}
- return new QJSValuePrivate(pathArray);
+ return new QJSValuePrivate(v4, pathArray.asValue());
}
void QDeclarativePolygonMapItem::setPath(const QJSValue &value)