PDA

View Full Version : Windows Batchfile Output to Form



teak421
1st August 2017, 07:21
Hi. New QT user here, apologies is this is a stupid question.

Is it possible to run a batch file (with QProcess) and have the output of said batchfile be sent to a widget inside of my MainWindow inside of Qt Creator? I'm reading the documentation on all the different widget types, but maybe I should see if this is even possible...

Thanks in advance.

teak

Ginsengelf
1st August 2017, 12:42
Hi, if you don't really need the batch file, then QProcess::readAllStandardOutput() might help, but you probably will not get the output of the batch file (that has normally been printed to a cmd window).
Maybe you could redirect the output to a file and read that.

Ginsengelf

teak421
1st August 2017, 15:33
Hi, if you don't really need the batch file, then QProcess::readAllStandardOutput() might help, but you probably will not get the output of the batch file (that has normally been printed to a cmd window).
Maybe you could redirect the output to a file and read that.

Ginsengelf

That would be fine as well... But, when I run the QProcess I see in task manager that the cmd window is opened, but the actual CMD "DOS" box doesn't show up on the screen...that's why I thought I would move it to the MainWindow. Thanks for your insight.

teak