Hi there,
I want to spawn several (solver) processes using QProcess in my program. I create the processes with
QProcess * p = new QProcess;
To copy to clipboard, switch view to plain text mode
and add them to my process list.
QList<QProcess*> p_list;
p_list.append(p);
QList<QProcess*> p_list;
p_list.append(p);
To copy to clipboard, switch view to plain text mode
I also connect the finished() and readyRead() and other signals to slots in my class spawning the processes. Since I do that for each process created, I have the problem of finding out which process actually emitted the signal.
For the readyRead() signal I simply loop over all processes and grap everything I can from each process, so that works somewhat. However, particularly for the task of detecting when a process is finished and deleting the process and removing it from the process list, I would like to know exactly, which of the processes emitted the finished() signal. How would I do that best?
In general what is the best practice for handling several processes running in parallel and reacting to signals?
Andreas
Bookmarks