@Ekia said in Never ending local Event Loop:
How would you suggest to post the request after starting the local event loop? Because as soon as I'm calling exec(), the execution is blocked there (sorry, I think that I missed something in your suggestion).
You could use QMetaObject::invokeMethod to place something into the local event loop even before it is run. I would usually put the current code into a lambda and place that lambda into the event loop using invokeMethod. (So, the invokeMethod would be done before calling exec().)
@Ekia said in Never ending local Event Loop:
Actually, I'm also thinking about an alternative solution with processEvents() + a timeout, but I'm not sure if it's the right way to go.
In that case I would use QTime (there used to be something like QTime::elapsed(), which in Qt 6 I would now replace with msecsTo(QTime::currentTime())). Usually, processEvents is not a good idea because it will slow your application down. However, if you are already willing to wait up to 10 seconds, maybe it is not too bad. I wish slots could be coroutines so that they are async, but you could write them as if they were synchronous (just with an occasional co_yield).