Switch to the non compat metacall overload
authorLars Knoll <lars.knoll@theqtcompany.com>
Tue, 11 Aug 2015 08:19:37 +0000 (10:19 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Wed, 19 Aug 2015 11:38:27 +0000 (11:38 +0000)
This one passes in the qobject that the metacall
is being applied to. The long term goal is to make the
vme meta object independent of the QObject instance.

Change-Id: Ide34b8637b9963bdb5e87e4aa6e9c2ee825293f7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/qml/qml/qqmlvmemetaobject.cpp
src/qml/qml/qqmlvmemetaobject_p.h
src/quick/designer/qqmldesignermetaobject.cpp
src/quick/designer/qqmldesignermetaobject_p.h

index ab33037..6021b1a 100644 (file)
@@ -457,8 +457,11 @@ QRectF QQmlVMEMetaObject::readPropertyAsRectF(int id)
     return v->d()->data.value<QRectF>();
 }
 
-int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
+int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void **a)
 {
+    Q_ASSERT(o == object);
+    Q_UNUSED(o);
+
     int id = _id;
     if (c == QMetaObject::WriteProperty && interceptors &&
        !(*reinterpret_cast<int*>(a[3]) & QQmlPropertyPrivate::BypassInterceptor)) {
index 3f289c2..5a4c3d2 100644 (file)
@@ -180,7 +180,7 @@ public:
     static QQmlVMEMetaObject *getForSignal(QObject *o, int coreIndex);
 
 protected:
-    virtual int metaCall(QMetaObject::Call _c, int _id, void **_a);
+    virtual int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a);
 
 public:
     friend class QQmlVMEMetaObjectEndpoint;
index e80012b..76c94b2 100644 (file)
@@ -226,7 +226,7 @@ int QQmlDesignerMetaObject::propertyOffset() const
     return cache->propertyOffset();
 }
 
-int QQmlDesignerMetaObject::openMetaCall(QMetaObject::Call call, int id, void **a)
+int QQmlDesignerMetaObject::openMetaCall(QObject *o, QMetaObject::Call call, int id, void **a)
 {
     if ((call == QMetaObject::ReadProperty || call == QMetaObject::WriteProperty)
             && id >= m_type->propertyOffset()) {
@@ -248,14 +248,16 @@ int QQmlDesignerMetaObject::openMetaCall(QMetaObject::Call call, int id, void **
     } else {
         QAbstractDynamicMetaObject *directParent = parent();
         if (directParent)
-            return directParent->metaCall(call, id, a);
+            return directParent->metaCall(o, call, id, a);
         else
             return myObject()->qt_metacall(call, id, a);
     }
 }
 
-int QQmlDesignerMetaObject::metaCall(QMetaObject::Call call, int id, void **a)
+int QQmlDesignerMetaObject::metaCall(QObject *o, QMetaObject::Call call, int id, void **a)
 {
+    Q_ASSERT(myObject() == o);
+
     int metaCallReturnValue = -1;
 
     const QMetaProperty propertyById = QQmlVMEMetaObject::property(id);
@@ -288,9 +290,9 @@ int QQmlDesignerMetaObject::metaCall(QMetaObject::Call call, int id, void **a)
 
     QAbstractDynamicMetaObject *directParent = parent();
     if (directParent && id < directParent->propertyOffset()) {
-        metaCallReturnValue = directParent->metaCall(call, id, a);
+        metaCallReturnValue = directParent->metaCall(o, call, id, a);
     } else {
-        openMetaCall(call, id, a);
+        openMetaCall(o, call, id, a);
     }
 
 
index eca4fb6..47f4baa 100644 (file)
@@ -68,8 +68,8 @@ protected:
     static QQmlDesignerMetaObject* getNodeInstanceMetaObject(QObject *object, QQmlEngine *engine);
 
     void createNewDynamicProperty(const QString &name);
-    int openMetaCall(QMetaObject::Call _c, int _id, void **_a);
-    int metaCall(QMetaObject::Call _c, int _id, void **_a);
+    int openMetaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a);
+    int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a);
     void notifyPropertyChange(int id);
     void setValue(int id, const QVariant &value);
     QVariant propertyWriteValue(int, const QVariant &);