I need to expose a (slot) function from C++ into QML with parameters as reference to be used on the QML side:

C++ side
Qt Code:
  1. class A : public QObject
  2. {
  3.  
  4. public slot:
  5. void func(int& i, QString& s);
  6. }
To copy to clipboard, switch view to plain text mode 

QML side
Qt Code:
  1. onClicked: {
  2. objectA.func(i,s)
  3. ..do something with i
  4. ..do something with s
  5. }
To copy to clipboard, switch view to plain text mode 

When I run the application, I receive an error message saying that javascript doesn't recognise i and s parameters. Any idea?