From 10771f86a99588196304b94bcba3aea7f3dc1fb8 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 18 Jun 2009 12:08:20 +1000 Subject: Allow synthesized and extension meta objects to work together --- src/declarative/qml/qmlvmemetaobject.cpp | 16 +++++++++++++--- src/declarative/qml/qmlvmemetaobject_p.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp index 0117448..4b2c64c 100644 --- a/src/declarative/qml/qmlvmemetaobject.cpp +++ b/src/declarative/qml/qmlvmemetaobject.cpp @@ -55,14 +55,18 @@ QmlVMEMetaObject::QmlVMEMetaObject(QObject *obj, QList *strData, int slotData, QmlRefCount *rc) -: object(obj), ref(rc), slotData(strData), slotDataIdx(slotData) +: object(obj), ref(rc), slotData(strData), slotDataIdx(slotData), parent(0) { if (ref) ref->addref(); *static_cast(this) = *other; this->d.superdata = obj->metaObject(); - QObjectPrivate::get(obj)->metaObject = this; + + QObjectPrivate *op = QObjectPrivate::get(obj); + if (op->metaObject) + parent = static_cast(op->metaObject); + op->metaObject = this; baseProp = propertyOffset(); baseSig = methodOffset(); @@ -101,6 +105,8 @@ QmlVMEMetaObject::~QmlVMEMetaObject() { if (ref) ref->release(); + if (parent) + delete parent; delete [] data; } @@ -172,6 +178,10 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int id, void **a) } } - return object->qt_metacall(c, id, a); + if (parent) + return parent->metaCall(c, id, a); + else + return object->qt_metacall(c, id, a); } + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlvmemetaobject_p.h b/src/declarative/qml/qmlvmemetaobject_p.h index 6f1e31b..17140ef 100644 --- a/src/declarative/qml/qmlvmemetaobject_p.h +++ b/src/declarative/qml/qmlvmemetaobject_p.h @@ -69,6 +69,7 @@ private: QBitArray vTypes; QList *slotData; int slotDataIdx; + QAbstractDynamicMetaObject *parent; }; QT_END_NAMESPACE -- cgit v0.12