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

  • Home
  • SEARCH
  • 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 3724456
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:38:51+00:00 2026-05-19T06:38:51+00:00

I have a slot that is called passing some arguments used in a QProcess.

  • 0

I have a slot that is called passing some arguments used in a QProcess.
I execute a external program with some of this arguments.
The problem is that I want to have a queue for these processes, waiting until the previous process is finished to launch the next.

What do you think is the best/easiest way?

Here my method/slot:

void FirstCase::CallApp(QString text, QString pathAndFileName)
{
   QString command = QString("App1.exe %1 -Z %2").arg(pathAndFileName).arg(message); 
   QProcess* process = new QProcess(this);
   process->start(command);
}

EDIT Here the solution, if you need it:

Following the QStringList idea, my CallApp method just adds the command to the QStringList like:

list << command;

And then calls to Execute();

void FirstCase::Execute()
{
   if(!list_.isEmpty()&&!executing_)
    {
        QProcess* p = new QProcess(this);
        QString c = list_.takeFirst();
        p->start(c);
        executing_=TRUE;
        connect(p, SIGNAL(finished(int)),this,SLOT(ExecFinished()));
    }
}

void FirstCase::ExecFinished()
{
    executing__=FALSE;
    Execute();
}
  • 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-05-19T06:38:53+00:00Added an answer on May 19, 2026 at 6:38 am

    You can use a QString queue to queue up your commands and store them. Then, start from the top of the queue, start a new process and connect its finished() signal to a slot. When that process finishes, start a new process if the queue is not empty and so forth.

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

Sidebar

Related Questions

I have a QLineEdit with a QCompleter. I want a slot myslot() called when
I've got a function called updateTheValue() that I have called using [self updateTheValue] for
I have to write a program that performs highly computationally intensive calculations. The program
I have a QT class instance, called C, (C inherits QOBJECT) that sends a
I have a taskbar menu that when clicked is connected to a slot that
I have previously solved a similar problem in this question , where I asked
Problem is that I keep getting the 'No Such Slot' runtime error in Qt
Hi I have problem in code that the following code retuning the error that
I would like to have a slot that calls the function of the appropriate
I have a process that is doing some heavy maths with gl rather than

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.