Foo
クラスで宣言された関数が 1 つあります。
Q_INVOKABLE void setImageUrl(const QString &imageUrl);
ただし、そのメソッドの関数インデックスを取得できません。
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
}
私は何が欠けていますか?