views:

220

answers:

1

My code is a plugin of a host software which gets limited processing time. Therefore, I create a second thread (via system API) and start QApplication there. That way, the GUI runs smoothly.

Now, I would like to run a QThread event loop in the original such that I could use Signal/Slot (Qt::QueuedConnection) to invoke functions that are not thread safe in the host software.

Is there a way to create such QThread event loop without creating a new thread?

Thanks!

A: 

Hi Liron!

I'm not quit sure if i get you right, but you can start your own event loop just by calling QEventLoop::exec() on a e.g. private class member.

Don't forget to call QEventLoop.exit().

Bye, Lars

Lars