[PyQt] Invoke function QML with arguments

Charlie Gentil ceg at redaction-developpez.com
Wed Feb 19 18:18:10 GMT 2014


I want to invoke a function from QML Python. I use this: 

It works fine, but now I have to pass arguments. 

I tried this: 

Q_ARG(int, 1020/*

My QML function :
*/   console.log(x)/*

But I have this error in return: 

*/QMetaObject::invokeMethod: No such method 
*/QMetaObject.invokeMethod(myObject, "myTest", Qt.DirectConnection, 
Q_ARG(int, 1020))/*
*/RuntimeError: QMetaObject.invokeMethod() call failed/*

Can you help me? 

In advance thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140219/23a24e00/attachment.html>

More information about the PyQt mailing list