Important: Please read the Qt Code of Conduct -

Cannot return from exec()

  • I use QDialog to implement interface for computationally extensive module. Dialog begins by exec() call.

    When pressing "Ok" button, application creates several posix threads.
    These threads connect with dialog with callback functions of type (particularly to send procents to dialog progress bar):

    void AcceptMessage(...)

    With this processEvents() call I keep GUI responsible. That's why, when user presees "Cancel" I expect app to quit.

    void Dialog::Cancel()
    // done();

    Dialog closes but threads (detached) don't close and EventLoop continues to functionalize. What can be the reason?

  • Lifetime Qt Champion

    Why do you need qApp->processEvents();?
    Is your dialog blocked by something?
    If your havy computation happens in other threads then there should not be any need for qApp->processEvents();

Log in to reply