Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Handling multiple process launches and updating progress via single function ?
Qt 6.11 is out! See what's new in the release blog

Handling multiple process launches and updating progress via single function ?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QtNube
    wrote on last edited by
    #1

    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" <&lt; input &lt;&lt; "-i" <&lt; input2 &lt;&lt; "-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)!

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QtNube
      wrote on last edited by
      #2

      Any little pointers will also help?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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 !

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved