Hello !
I'm stuck with understanding threads.
First, the prerequisites I want to cope with :
  1. have a window that display an image of my code's evolution
  2. have an event loop running for this window, because I want to be able for instance to change camera via user mouse input
  3. keep my code's main operations in the main thread, because my code has to run both with and without Qt
  4. preferencially keep QApplication in the main thread, because I assume that otherwise I would somehow have to rewrite every other Qt Instance with threads and I don't really have time to achieve that


So, I want to have a widget (QDialog) that displays things coming from the main thread (1). In the beginning, I had a look at non modal dialog, but the problem is that QDialog->exec() stucks the main program in a processEvent() loop, and QDialog->show() does not process asynchroneous events from user, and need frequent updates that I can't ensure (especially with 3D images, for which moving the camera is a frame by frame action).

Therefore, I went into thread, but I can't get it to work. I understood that every QWidget has to be in the main thread, but I tried to trigger the static function of QCoreApplication:rocessEvents() from various threads with loops, to call it from inside a function of the Widget, to call it directly from a «worker» QObject (as shown in https://doc.qt.io/qt-5/qthread.html#details) but it does not accept to work this way, in this example, the «most important part of the operation» has to be done in the worker, which does not comply with (4).
I've also read carefully https://doc.qt.io/qt-5/threads-qobject.html ... but I'm confused.

Thanks in advance for any idea about how this is supposed to be done !