ReadFunction(object, property, &rv, notifier);
return QV4::QObjectWrapper::wrap(v4, rv);
} else if (property.isQList()) {
- return QmlListWrapper::create(engine, object, property.coreIndex, property.propType);
+ return QmlListWrapper::create(v4, object, property.coreIndex, property.propType);
} else if (property.propType == QMetaType::QReal) {
qreal v = 0;
ReadFunction(object, property, &v, notifier);
QQmlListProperty<QObject> prop(context->asQQmlContext(), (void*) qintptr(propertyIdx),
QQmlContextPrivate::context_count,
QQmlContextPrivate::context_at);
- return QmlListWrapper::create(engine, prop, qMetaTypeId<QQmlListProperty<QObject> >());
+ return QmlListWrapper::create(v4, prop, qMetaTypeId<QQmlListProperty<QObject> >());
} else {
return engine->fromVariant(cp->propertyValues.at(propertyIdx));
}
DEFINE_OBJECT_VTABLE(QmlListWrapper);
-Heap::QmlListWrapper::QmlListWrapper(QV8Engine *engine)
- : Heap::Object(QV8Engine::getV4(engine))
- , v8(engine)
+Heap::QmlListWrapper::QmlListWrapper(ExecutionEngine *engine)
+ : Heap::Object(engine)
{
setVTable(QV4::QmlListWrapper::staticVTable());
- QV4::Scope scope(QV8Engine::getV4(engine));
+ QV4::Scope scope(engine);
QV4::ScopedObject o(scope, this);
o->setArrayType(Heap::ArrayData::Custom);
}
{
}
-ReturnedValue QmlListWrapper::create(QV8Engine *v8, QObject *object, int propId, int propType)
+ReturnedValue QmlListWrapper::create(ExecutionEngine *engine, QObject *object, int propId, int propType)
{
if (!object || propId == -1)
return Encode::null();
- ExecutionEngine *v4 = QV8Engine::getV4(v8);
- Scope scope(v4);
+ Scope scope(engine);
- Scoped<QmlListWrapper> r(scope, v4->memoryManager->alloc<QmlListWrapper>(v8));
+ Scoped<QmlListWrapper> r(scope, engine->memoryManager->alloc<QmlListWrapper>(engine));
r->d()->object = object;
r->d()->propertyType = propType;
void *args[] = { &r->d()->property, 0 };
return r.asReturnedValue();
}
-ReturnedValue QmlListWrapper::create(QV8Engine *v8, const QQmlListProperty<QObject> &prop, int propType)
+ReturnedValue QmlListWrapper::create(ExecutionEngine *engine, const QQmlListProperty<QObject> &prop, int propType)
{
- ExecutionEngine *v4 = QV8Engine::getV4(v8);
- Scope scope(v4);
+ Scope scope(engine);
- Scoped<QmlListWrapper> r(scope, v4->memoryManager->alloc<QmlListWrapper>(v8));
+ Scoped<QmlListWrapper> r(scope, engine->memoryManager->alloc<QmlListWrapper>(engine));
r->d()->object = prop.object;
r->d()->property = prop;
r->d()->propertyType = propType;
if (!d()->object)
return QVariant();
- return QVariant::fromValue(QQmlListReferencePrivate::init(d()->property, d()->propertyType, d()->v8->engine()));
+ return QVariant::fromValue(QQmlListReferencePrivate::init(d()->property, d()->propertyType, d()->internalClass->engine->v8Engine->engine()));
}
namespace Heap {
struct QmlListWrapper : Object {
- QmlListWrapper(QV8Engine *engine);
+ QmlListWrapper(ExecutionEngine *engine);
~QmlListWrapper();
- QV8Engine *v8;
QPointer<QObject> object;
QQmlListProperty<QObject> property;
int propertyType;
V4_OBJECT2(QmlListWrapper, Object)
V4_NEEDS_DESTROY
- static ReturnedValue create(QV8Engine *v8, QObject *object, int propId, int propType);
- static ReturnedValue create(QV8Engine *v8, const QQmlListProperty<QObject> &prop, int propType);
+ static ReturnedValue create(ExecutionEngine *engine, QObject *object, int propId, int propType);
+ static ReturnedValue create(ExecutionEngine *engine, const QQmlListProperty<QObject> &prop, int propType);
QVariant toVariant() const;
typedef QQmlListReferencePrivate QDLRP;
QDLRP *p = QDLRP::get((QQmlListReference*)ptr);
if (p->object) {
- return QV4::QmlListWrapper::create(this, p->property, p->propertyType);
+ return QV4::QmlListWrapper::create(scope.engine, p->property, p->propertyType);
} else {
return QV4::Encode::null();
}