summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qmlvmemetaobject.cpp16
-rw-r--r--src/declarative/qml/qmlvmemetaobject_p.h1
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<QString> *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<QMetaObject *>(this) = *other;
this->d.superdata = obj->metaObject();
- QObjectPrivate::get(obj)->metaObject = this;
+
+ QObjectPrivate *op = QObjectPrivate::get(obj);
+ if (op->metaObject)
+ parent = static_cast<QAbstractDynamicMetaObject*>(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<QString> *slotData;
int slotDataIdx;
+ QAbstractDynamicMetaObject *parent;
};
QT_END_NAMESPACE