[Interest] Relationship between a QEventLoop and QCoreApplication::exec().

Thiago Macieira thiago.macieira at intel.com
Thu Aug 4 20:20:58 CEST 2016


On quinta-feira, 4 de agosto de 2016 10:32:26 PDT John Weeks wrote:
> > On Aug 4, 2016, at 10:04 AM, Thiago Macieira <thiago.macieira at intel.com>
> > wrote:
> > 
> > Starting an event loop from inside another event loop.
> > 
> > exec() → some slot or event handler → exec()
> 
> OK, so that would cover any use of QEventLoop::exec() in the main thread.

Correct, unless you did it in the main() function before or instead of 
QCoreApplication::main().

> It would also seem to cover any use of QDialog::exec() in the main thread,
> and QDialog can be used only in the main thread.

Correct. Don't use exec(). Call show() it and return to the existing mainloop.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list