 <p>As others already wrote, I believe this behavior is caused by the fact that the dialog starts its own event loop.</p> <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>