<div>I want to call a C++/QML method from PyQt via QMetaObject.invokeMethod like so:</div><br><div>        return_val = QMetaObject.invokeMethod(</div><div>            self._graph, "insertNode", Qt.DirectConnection, Q_RETURN_ARG(QVariant)</div><div>        )</div><br><div>The method I call is <a href="https://github.com/cneben/QuickQanava/blob/master/src/qanGraph.h#L335" title="https://github.com/cneben/QuickQanava/blob/master/src/qanGraph.h#L335">https://github.com/cneben/QuickQanava/blob/master/src/qanGraph.h#L335</a> which returns a custom QML registered QObject based type.</div><br><div>However, when I try to invoke the method Q_RETURN_ARG it fails.</div><div>FATAL ERROR: An unexpected error occurred:</div><div>QMetaObject.invokeMethod() call failed</div><br><div>Without specifying a return type, invoking the method works. Since it's a type registered in the Qt meta object system, I expected that QVariant or QObject would work as return types.</div><br><div>Any ideas why this doesn't work and how I could use the returned QObject without "siping" the whole library?</div><br><div>Alex</div>