Handling multiple process launches and updating progress via single function ?
-
I am learning Qt and use the following code to launch external application and process output received from it :
@
void Dialog::on_startButton_clicked()
{QString program = "C:/Program Files/ffmpeg/bin/ffmpeg.exe"; mTranscodingProcess = new QProcess(this); connect(mTranscodingProcess, SIGNAL(started()), this, SLOT(processStarted()));
connect(mTranscodingProcess,SIGNAL(readyReadStandardOutput()),this,SLOT(readyReadStandardOutput()));
connect(mTranscodingProcess, SIGNAL(finished(int)), this, SLOT(encodingFinished()));QStringList arguments; QString input = "myfile_path_1"; QString input2 = "myfile_path_2"; arguments << "-y" << "-i" << input << "-i" << input2 << "-c" << "copy" << "output.avi" ; qDebug() << arguments; mTranscodingProcess->setProcessChannelMode(QProcess::MergedChannels); mTranscodingProcess->start(program, arguments);
}
@Now, I need to know :
(a). How to launch additional jobs of the above and receive separate updates from each instance.
(b). How to achieve a interface like one below (see repeated information panels with thumbnail title and progress) updating progress updates from individual threads launched in step a above.!http://a.fsdn.com/con/app/proj/four-k-download/screenshots/slide-vd-4.jpg(Interface)!
-
Hi and welcome to devnet,
Please allow 24 to 72 hours before bumping your own thread, not all forum users are living in the same timezone as you.
As for your questions, have a look at QtConcurrent for the multiple job problem and Qt's MVC module for the widget part
Happy coding !