I need to expose a (slot) function from C++ into QML with parameters as reference to be used on the QML side:
C++ side
{
public slot:
void func(int& i, QString& s);
}
class A : public QObject
{
public slot:
void func(int& i, QString& s);
}
To copy to clipboard, switch view to plain text mode
QML side
onClicked: {
objectA.func(i,s)
..do something with i
..do something with s
}
onClicked: {
objectA.func(i,s)
..do something with i
..do something with s
}
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?
Bookmarks