Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8134953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:14:14+00:00 2026-06-06T10:14:14+00:00

I want to optimize images with the help of some external programs. The programs

  • 0

I want to optimize images with the help of some external programs. The programs must be executed one after one, some of them depending on the output of the last program, some of them depending on the characteristics of the image.

I know, I can use signals, but this is not very useful here, because I would have to use dozens of functions and signals for each and every external program, some of them even multiple times depending on the position, where a program is called in the chain. It would be much easier to execute them one by one. But if I do so, the gui freezes immidiately even without displaying the status message until all processes are finished. What else can I do?

ui->status->setText("Do something with program 1");

QProcess *proc1 = new QProcess;
proc1->setReadChannelMode(QProcess::SeparateChannels);
proc1->start("program 1 -args", QIODevice::ReadWrite);

while(!proc1->waitForFinished(10))
    ;

ui->status->setText("Do something with program 2");

QProcess *proc2 = new QProcess;
proc2->setReadChannelMode(QProcess::SeparateChannels);
proc2->start("program 2 -args", QIODevice::ReadWrite);

while(!proc2->waitForFinished(10))
    ;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:14:15+00:00Added an answer on June 6, 2026 at 10:14 am

    In this case using Signals is the “correct” way. You just need to chain them.

    [...]
    ui->status->setText("Do something with program 1");
    proc1.setReadChannelMode(QProcess::SeparateChannels);
    proc1.start("program 1 -args", QIODevice::ReadWrite);
    connect(proc1, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finishedProc1()))
    [...]
    
    void finishedProc1()
    {
       ui->status->setText("Do something with program 2");
       proc2.setReadChannelMode(QProcess::SeparateChannels);
       proc2.start("program 2 -args", QIODevice::ReadWrite);
       connect(proc2, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finishedProc2()))
    }
    
    void finishedProc2()
    {
      [...]
    }
    

    Alternativly you could call processEvents in QApplication while you are waiting or do the whole thing in a different QThread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So the situation is: I want to optimize my code some for doing counting
I have a lot of jpeg images which I want to optimize for web
I'm just looking to optimize the code below. It works, but I want to
Per the Google Page Speed recommendations, I want to Specify image dimensions to Optimize
I want to optimize my face detection algorithm by scaling down the image. What
I want to scale images to 400x400 (I am creating thumbnails). I am using
Hai guys, I want compress my images without changing the quality... Because my web
I often doing such steps and want to optimize debug speed: I am setting
I want to implement some image-processing algorithms which are intended to run on a
I'm having trouble with some jQuery stuff, please help me out. Below is my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.