diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-05-08 15:32:31 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:14 +0200 |
commit | 76f3a874f42a5fc689334fa371f386762e37cc78 (patch) | |
tree | 62f2880ce6e2c6209e559bdf591385037a8c5eb2 /src/qml/util | |
parent | 519471a77a67bb72f4d0995db70a95f290b13c6a (diff) |
Convert delegate model and indexed builtin function
Change-Id: Ic7d50aa472d6a1bafadb6641f88b5f89a9b893ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/util')
-rw-r--r-- | src/qml/util/qqmladaptormodel.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index 446020d36b..d33000559b 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -227,8 +227,10 @@ public: const QByteArray &propertyName = it.key(); QV4::ScopedString name(scope, v4->newString(QString::fromUtf8(propertyName))); - p->setGetter(new (v4->memoryManager) QV4::IndexedBuiltinFunction(v4->rootContext, propertyId, QQmlDMCachedModelData::get_property)); - p->setSetter(new (v4->memoryManager) QV4::IndexedBuiltinFunction(v4->rootContext, propertyId, QQmlDMCachedModelData::set_property)); + QV4::ScopedFunctionObject g(scope, new (v4) QV4::IndexedBuiltinFunction::Data(v4->rootContext, propertyId, QQmlDMCachedModelData::get_property)); + QV4::ScopedFunctionObject s(scope, new (v4) QV4::IndexedBuiltinFunction::Data(v4->rootContext, propertyId, QQmlDMCachedModelData::set_property)); + p->setGetter(g); + p->setSetter(s); proto->insertMember(name.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); } prototype = proto; @@ -431,7 +433,7 @@ public: } QV4::Scope scope(v4); QV4::ScopedObject proto(scope, type->prototype.value()); - QV4::ScopedObject o(scope, new (proto->engine()->memoryManager) QQmlDelegateModelItemObject(proto->engine(), this)); + QV4::ScopedObject o(scope, new (proto->engine()) QQmlDelegateModelItemObject::Data(proto->engine(), this)); o->setPrototype(proto.getPointer()); ++scriptRef; return o.asReturnedValue(); @@ -609,7 +611,7 @@ public: { QQmlAdaptorModelEngineData *data = engineData(v4->v8Engine); QV4::Scope scope(v4); - QV4::ScopedObject o(scope, new (v4->memoryManager) QQmlDelegateModelItemObject(v4, this)); + QV4::ScopedObject o(scope, new (v4) QQmlDelegateModelItemObject::Data(v4, this)); QV4::ScopedObject p(scope, data->listItemProto.value()); o->setPrototype(p.getPointer()); ++scriptRef; |