aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlopenmetaobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-09-10 14:29:28 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-09-25 18:53:13 +0000
commit10a712eb980f32492c65dcb8441f6c5d29192a82 (patch)
tree3eacea58472a7a275bd171382b406d8d0fae4e6c /src/qml/qml/qqmlopenmetaobject.cpp
parent9d58167d352b2f860f473fd74b63541d7659b811 (diff)
Reimplement the right metaCall() method
The goal should be to make these dynamic metaobjects independent of the concrete QObject instance. Change-Id: I13448420d15792918cc30e994a8d6d83216a0a1a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlopenmetaobject.cpp')
-rw-r--r--src/qml/qml/qqmlopenmetaobject.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlopenmetaobject.cpp b/src/qml/qml/qqmlopenmetaobject.cpp
index 16138508dd..9188ba6174 100644
--- a/src/qml/qml/qqmlopenmetaobject.cpp
+++ b/src/qml/qml/qqmlopenmetaobject.cpp
@@ -261,8 +261,10 @@ void QQmlOpenMetaObject::emitPropertyNotification(const QByteArray &propertyName
activate(d->object, *iter + d->type->d->signalOffset, 0);
}
-int QQmlOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a)
+int QQmlOpenMetaObject::metaCall(QObject *o, QMetaObject::Call c, int id, void **a)
{
+ Q_ASSERT(d->object == o);
+
if (( c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty)
&& id >= d->type->d->propertyOffset) {
int propId = id - d->type->d->propertyOffset;
@@ -276,15 +278,15 @@ int QQmlOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a)
prop.first = propertyWriteValue(propId, *reinterpret_cast<QVariant *>(a[0]));
prop.second = true;
propertyWritten(propId);
- activate(d->object, d->type->d->signalOffset + propId, 0);
+ activate(o, d->type->d->signalOffset + propId, 0);
}
}
return -1;
} else {
if (d->parent)
- return d->parent->metaCall(c, id, a);
+ return d->parent->metaCall(o, c, id, a);
else
- return d->object->qt_metacall(c, id, a);
+ return o->qt_metacall(c, id, a);
}
}