title: How does qDebug() print enum values?
body: <p>We have a simple piece of code in our application:</p>
  
  <pre><code>void tAccessPoint::OnStateChanged(QAbstractSocket::SocketState state)
  {
      qDebug() &lt;&lt; m_ID &lt;&lt; " " &lt;&lt; state;
  </code></pre>
  
  <p>For reasons that aren't important here I was attempting to replace the use of qDebug so I used the code from this post <a href="https://stackoverflow.com/questions/303562/c-format-macro-inline-ostringstream">C++ format macro / inline ostringstream</a>. But I was surprised to find that when I do this <strong>state</strong> no longer appears as a text value but rather as a numeric value. qDebug() seems to know what the name of the enum value is rather than just the value. How does it do this, and can I do the same in my code?</p>