Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling command prompt from Qt application without freezing?

In my Qt GUI application, I am calling the command prompt through:

system("lots.exe & of.exe && commands.exe");

It opens up the command prompt (like I want it to), but freezes the Qt GUI application until I close the command prompt. Is there someway to prevent this? I saw that there is a QProcess class, but can't get it to bring up the command prompt.

Any help would be greatly appreciated!

like image 678
Joel Avatar asked Jul 15 '10 21:07

Joel


1 Answers

QProcess is really the answer. If you want to use something like system() you'll have to either put the call in another thread or use popen or something simmilar for your platforms.

QProcess does have the setReadChannel which you could use to display your own console window to show the output.

like image 198
Gianni Avatar answered Sep 30 '22 03:09

Gianni