How to pass variables as reference from C++ to QML
I need to expose a (slot) function from C++ into QML with parameters as reference to be used on the QML side:
C++ side
Code:
{
public slot:
void func(int& i, QString& s);
}
QML side
Code:
onClicked: {
objectA.func(i,s)
..do something with i
..do something with s
}
When I run the application, I receive an error message saying that javascript doesn't recognise i and s parameters. Any idea?
Re: How to pass variables as reference from C++ to QML
we will need more info:
in your javascript i and s doesn't seems to be defined.
were do they come from ?