I would like to confirm that, in my opinion, is a direct aspect of workflows in Qt.
Suppose I create a QThread whose purpose is to manage the time-consuming work in the corresponding thread. Also, suppose I allow this thread to start the corresponding event loop by calling start() in QThread. The work itself is performed by a member function (slot), which is signaled by the QThread started() signal.
That is (copying from https://stackoverflow.com/a/330965/ ... ):
class Task : public QObject { Q_OBJECT public: Task(); ~Task(); public slots: void doWork() {
My question is the following. I understand that a workflow event loop will receive a trigger from the finished() signal to call the deleteLater() slot on the task instance. In addition, this event loop will be launched shortly after the doWork() function doWork() , and therefore it will be ready and available for processing a trigger from the finished() signal, which was simply added to the workflow event queue by calling finished() at the end of the doWork()
I would like to confirm that during the entire duration of the temporary operation inside doWork() (before finished() is released and before the doWork() function doWork() ), the event loop inside the workflow is locked in the doWork() slot function, and therefore, the workflow will NOT respond to any slots that run on any objects that belong to the event loop thread; during the course, the doWork() time-consuming function is doWork() . (And therefore, any such slots will only be executed after doWork() exits after the doWork() event loop is active again and before the trigger from the finished() signal is processed.)
I suspect this is so, but I want to confirm.
Thanks!
source share