title: How does Qt implement signals and slots?
body: <p>Can someone explain to me the basic idea of Qt signals&amp;slots mechanism IMPLEMENTATION?
  I want to know what all those Q_OBJECT macros do "in plain C++".
  This question is NOT about signals&amp;slots usage.</p>
  
  <p>added:
  I know that Qt uses moc compiler to transform Qt-C++ in plain C++.
  But what does moc do?
  I tried to read "moc_filename.cpp" files but I have no idea what can something like this mean</p>
  
  <pre><code>void *Widget::qt_metacast(const char *_clname)
  {
  if (!_clname) return 0;
  if (!strcmp(_clname, qt_meta_stringdata_Widget))
      return static_cast&lt;void*&gt;(const_cast&lt; Widget*&gt;(this));
  return QDialog::qt_metacast(_clname);
  }
  </code></pre>