title: QMetaMethod from member function pointer
body: <p>Given a pointer to a method of a <code>QObject</code> derived class: Is there a way of getting the <code>QMetaMethod</code> of the method the pointer is pointing to? I am basically looking for a function like <code>QMetaMethod::fromSignal</code>, but for slots.</p>
  
  <hr>
  
  <p><em>Note:</em>
  I tried getting the index through <code>static_metacall</code> with <code>QMetaObject::IndexOfMethod</code> and using that for <code>QMetaObject::method</code>:</p>
  
  <pre><code>void(Class::*method)() = &amp;Class::method;
  int methodIndex = -1;
  void *metaArgs[] = {&amp;methodIndex, reinterpret_cast&lt;void **&gt;(&amp;method)};
  const QMetaObject mo = Class::staticMetaObject;
  mo.static_metacall(QMetaObject::IndexOfMethod, 0, metaArgs);
  qDebug() &lt;&lt; methodIndex;
  // QMetaMethod mm = mo.method(methodIndex)
  </code></pre>
  
  <p>The output is always -1.</p>