title: How to catch exceptions in Qt?
body: <pre><code>try
  {  // `count()` throws exception
    connect(thread, SIGNAL(started()), engine, SLOT(count()));  
  }
  catch(const X&amp; e)
  {}
  </code></pre>
  
  <p>As of Qt-5, I get following error:</p>
  
  <blockquote>
    <p>Qt has caught an exception thrown from an event handler. Throwing
    exceptions from an event handler is not supported in Qt.
    You must not let any exception whatsoever propagate through Qt code.
    If that is not possible, in Qt 5 you must at least re-implement
    <code>QCoreApplication::notify()</code> and catch all exceptions there.</p>
  </blockquote>
  
  <p>If I can't catch the exceptions in conventional way as shown above, then where are we supposed to catch those?</p>