I have one function declared in Foo
class:
Q_INVOKABLE void setImageUrl(const QString &imageUrl);
However I cannot get the function index of that method:
Foo* foo = new Foo();
const QMetaObject* metaObject = foo->metaObject();
QString functionNameWithparameter("setImageUrl(QString)");
int functionIndex = metaObject->indexOfMethod(functionNameWithParameter.toStdString().c_str());
if (functionIndex >= 0) {
// never the case
}
What am I missing?