I'd like to create a library built on top of QTcpServer
and QTcpSocket
for use in programs that don't have event loops in their main
functions (because the Qt event loop is blocking and doesn't provide enough timing resolution for the real-time operations required).
I was hoping to get around this by creating local event loops within the class, but they don't seem to work unless I've called app->exec()
in the main function first. Is there some way to create local event loops and allow for signal/slot communication within a thread without having an application level event loop?
I've already looked at Is there a way to use Qt without QApplication::exec()? but the answer doesn't help because it seems like the solution adds a local event loop but doesn't remove the application loop.
QApplication::exec()
and keep it alive as the "main thread"? – PublisherQApplication::exec
– Ritualism