<p>Does any one know how the event handler manages the posted events?</p>

<p>In my app i have two threads (<em>guiThread</em> and <em>computationThread</em>). After an exception is thrown I call <code>postEvent(..)</code> to an existing dialog. The Qt-Event-Handler holds this one back until the dialog is closed. </p>

<hr>

<p>Sorry my question is a bit cloudy. I will write it more exactly, if I have time left. I found a work around. But for me the problem is still interesting.</p>

[{'answer_id': 53866, 'author': 'Jérôme', 'author_id': 2796, 'author_profile': 'https://Stackoverflow.com/users/2796', 'pm_score': 2, 'selected': False, 'text': '<p>As mentionned in the Qt documentation about <a href="http://doc.qt.io/qt-4.8/qcoreapplication.html#postEvent" rel="nofollow noreferrer">QCoreApplication::postEvent</a> :</p>\n\n<blockquote>\n  <p>When control returns to the main event loop, all events that are stored in the queue will be sent using the notify() function. </p>\n</blockquote>\n\n<p>...which explains why the Qt Event Handler holds the event until the dialog is closed. </p>\n\n<p>If I understand correctly what you want to do, I would try using <a href="http://doc.qt.io/qt-4.8/qcoreapplication.html#sendEvent" rel="nofollow noreferrer">sendEvent</a>.</p>\n'}, {'answer_id': 66644, 'author': 'Caleb Huitt - cjhuitt', 'author_id': 9876, 'author_profile': 'https://Stackoverflow.com/users/9876', 'pm_score': 1, 'selected': False, 'text': "<p>I'm guessing that the dialog you created is modal, which would mean that it is running its own event loop.  No events posted to the general guiThread will be processed until all modal event loops are exited.</p>\n\n<p>Alternately, if you need the dialog to both be modal and know about the event, you could post the event directly to the dialog.  You'll need to figure out how to handle pointers in a shared manner, but if nothing complicated is going on, you might be able to use the QApplication::activeWindow() function.</p>\n"}, {'answer_id': 152857, 'author': 'Aurélien Gâteau', 'author_id': 20107, 'author_profile': 'https://Stackoverflow.com/users/20107', 'pm_score': 0, 'selected': False, 'text': '<p>As others already wrote, I believe this behavior is caused by the fact that the dialog starts its own event loop.</p>\n\n<p>If you use Qt4, you can try using <a href="http://doc.qt.io/qt-4.8/threads-qobject.html#signals-and-slots-across-threads" rel="nofollow noreferrer">queued signal/slot connections</a> as an alternative to posting events.</p>\n'}]
['https://Stackoverflow.com/questions/52772', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5334/']