title: MessageHandler Qt
body: <p>I would like to create an extra <code>QtMsgType</code>. So I wrote a messagehandler that handles all the default types. <code>qDebug()</code> for <code>QtDebugMsg</code>, <code>qWarning()</code> for <code>QtWarningMsg</code> etc.</p>
  
  <p>In the Qt source:</p>
  
  <pre><code>enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
  </code></pre>
  
  <p>My messageHandler that is registered with <code>qInstallMsgHandler</code>:</p>
  
  <pre><code>void messageHandler(QtMsgType type, const QMessageLogContext&amp;, const QString&amp; msg) {
      switch (type){
      case QtDebugMsg:    OutputMessageHandler::getHandler()-&gt;debug(msg);   break;
      case QtWarningMsg:  OutputMessageHandler::getHandler()-&gt;warning(msg); break;
      case QtCriticalMsg: OutputMessageHandler::getHandler()-&gt;error(msg);   break;
      case QtFatalMsg:    OutputMessageHandler::getHandler()-&gt;fatal(msg);   break;
      }
  }
  </code></pre>
  
  <p>I would like to have a <code>qMyCustomMessage()</code> with a <code>MyCustomMsg</code> such that my handler catches it like it catches <code>qDebug()</code> but i don't know exactly how I could do that. Is there any way to achieve that? Thanks in advance.</p>