title: SIGNAL & SLOT macros in Qt : what do they do?
body: <p>I'm a beginner in Qt and trying to understand the <code>SIGNAL</code> and <code>SLOT</code> macros. When I'm learning to use the <code>connect</code> method to bind the signal and slot, I found the tutorials on Qt's official reference page uses:</p>
  
  <pre><code>connect(obj1, SIGNAL(signal(int)), obj2, SLOT(slot()))
  </code></pre>
  
  <p>However, this also works very well:</p>
  
  <pre><code>connect(obj1, &amp;Obj1::signal, obj2, &amp;Obj2::slot)
  </code></pre>
  
  <p>So what exactly do the macros <code>SIGNAL</code> and <code>SLOT</code> do? Do they just look for the signal in the class the object belongs to and return the address of it?</p>
  
  <p>Then why do most programmers use these macros instead of using <code>&amp;Obj1::signal</code> since the latter appears to be simpler and you don't need to change the code if the parameters of the signal function change?</p>