How to use indexOfMethod
-
Hi
I am trying to use the indexOfMethod method in QMetaObject and am a little confused.
Here is my code -
@
const QMetaObject* metaObject = m_parent->metaObject();
for (int i = 0; i < metaObject->methodCount(); ++i)
{
QMetaMethod m = metaObject->method(i);
qDebug() << m.name();
}
int methodIndex = metaObject->indexOfMethod(QMetaObject::normalizedSignature("testSlot"));
@
When the application is run I can see 'testSlot' is output by the debug call, however, indexOfMethod returns -1 meaning it was not found.What am I doing wrong?
All help appreciated
Thanks
-
Hi,
What is the complete signature of testSlot ?