It works just fine for me.

Qt Code:
  1. #include <QtGui>
  2. #include <QtQml>
  3.  
  4. int main(int argc, char **argv) {
  5. QGuiApplication app(argc, argv);
  6. QQmlEngine e;
  7. QQmlComponent c(&e, "test.qml");
  8. QObject *o = c.create();
  9. QVariantMap m;
  10. m["i"] = 10;
  11. m["name"] = "someName";
  12. QVariant v = m;
  13. QVariant ret;
  14. QMetaObject::invokeMethod(o, "testFunc", Q_RETURN_ARG(QVariant, ret), Q_ARG(QVariant, v));
  15. // return app.exec();
  16. return 0;
  17. }
To copy to clipboard, switch view to plain text mode 

javascript Code:
  1. import QtQml 2.0
  2.  
  3. QtObject {
  4. function testFunc(v) { console.log("v.name = ", v.name); }
  5. }
To copy to clipboard, switch view to plain text mode