Gaurav Kumar
Gaurav Kumar

Reputation: 9

How to run a QProcess in background?

I want to create a QProcess and run it in background. I have a scheduler that maintains a queue of jobs to be launched as QProcesses. These QProcess have commands that are run in an lsf machine. The requirement is that once a QProcess is running I have to poll the QProcess and get its status. To poll the qprocess and get its status it has to be run in background. If it's not run in background, the moment qprocess is launched it will show its status as 0. I want to fetch the status of qprocess running the command in lsf machine.How to run the QProcess in background to get the coreect status. if QProcess running the unix command, QProcess poll should show it as running.

Upvotes: 1

Views: 2511

Answers (1)

Nikos C.
Nikos C.

Reputation: 51920

A QProcess runs asynchronously (in the "background") by default. You don't need to do anything special.

Create a QProcess instance, set up your signal/slots connections, and then start the process through one of the QProcess::start() functions.

Upvotes: 1

Related Questions