Learner
Learner

Reputation: 1

QProcessBar in Qt

I want to build a progress bar that shows the progress of one process which is executed by QProcess::execute(QString); in my GUI.

Problem is when I execute it, then my GUI hangs and I can't do anything within it.

At least, I would like to to show a loading image which shows the something is happening behind the GUI.

Upvotes: 0

Views: 338

Answers (2)

AngryDuck
AngryDuck

Reputation: 4607

Actually you need to use threads if your GUI is hanging, have a look at QFuture

Upvotes: 0

dunc123
dunc123

Reputation: 2713

You'll need to use QProcess::start rather than execute. Execute will block until the process exits.

QProcess *myProcess = new QProcess(parent);
myProcess->start(program, arguments);

Check the QProcess documentation for more details.

Upvotes: 2

Related Questions