Solved loop for not waiting the end of process
-
-
@filipdns oh he is meaning the process declaration may be?
In this case ok, I try
-
@filipdns I try the provided code and it didn't work...
-
@filipdns said in loop for not waiting the end of process:
@jsulm Hello, I seen this advise but I didn't understand how I have to do else than put the process in the loop
Well there's nothing else. Just put it inside. Then you will be certain 100% that next time the loop iterates, it will delete the old process and create a new, fresh one.
-
@sierdzio I just understand what this code it suppose to do and very good idea, I adopt it!! Big thanks !!!!!
for(int i=0;i<images.count();i++) { //do whatever you need to do //qDebug() << "Loop block begins"; filename=images[i]; outfilename=filename.split(".")[0]; program2=QDir::toNativeSeparators("//DGS1109N007/Echanges_SAA/Affichage/Display/imagmagick/magick ")+ "convert -density 300 -trim "+ QDir::toNativeSeparators("\"//DGS1109N007/Echanges_SAA/Affichage/Messages/"+filename)+"\" -quality 100 "+QDir::toNativeSeparators("\"//DGS1109N007/Echanges_SAA/Affichage/Display/Messages/"+outfilename+".jpg"); if(myProcess2.state()!= QProcess::Running) { myProcess2.start(program2); myProcess2.waitForStarted(6000); if(myProcess2.waitForFinished(6000) == false) qInfo() << "Process had some trouble" << myProcess2.errorString() << program; } }
-
@filipdns I don't see you adopting it in your last code snippet...