summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-06-18 02:08:20 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-06-18 02:08:20 (GMT)
commit10771f86a99588196304b94bcba3aea7f3dc1fb8 (patch)
treef043b1cae42db07045b31187165db4934fbf7dca /src/declarative/qml
parent1e6a8054cfcd5217fbea390fc2395fcb5af588e7 (diff)
downloadQt-10771f86a99588196304b94bcba3aea7f3dc1fb8.zip
Qt-10771f86a99588196304b94bcba3aea7f3dc1fb8.tar.gz
Qt-10771f86a99588196304b94bcba3aea7f3dc1fb8.tar.bz2
Allow synthesized and extension meta objects to work together
Diffstat (limited to 'src/declarative/qml')
-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