Qt5.5.1
QtCreator 3.5.1
Windows 7
Hello,
I'm runnning a QProcess, and it runs fine. (7z, command line version of 7Zip)
The command I'm running outputs to the command prompt console continuously changing the % value
of the un-zipping progress. Run from the command prompt, shows:-
15% - myFile.zip
15% - myFile.zip
To copy to clipboard, switch view to plain text mode
What I can't work out is how to redirect the console to my program, so I can show a progress bar.
I underatand the QPogressBar procedures.
Thanks for any advice offered.
Regards
process
->setProcessChannelMode
(QProcess::ForwardedChannels);
process->start(cmd);
do {
delay(1000); //processes events
qDebug() << "o - " << (process->readAllStandardOutput());
qDebug() << "e - " << (process->readAllStandardError());
} while(busy); //flag, changes when QProcess finishes, signal connected to slot
process->waitForFinished(-1); // -1, forever
process->close();
process->setProcessChannelMode(QProcess::ForwardedChannels);
process->start(cmd);
do {
delay(1000); //processes events
qDebug() << "o - " << (process->readAllStandardOutput());
qDebug() << "e - " << (process->readAllStandardError());
} while(busy); //flag, changes when QProcess finishes, signal connected to slot
process->waitForFinished(-1); // -1, forever
process->close();
To copy to clipboard, switch view to plain text mode
Output:-
o - ""
e - ""
o - ""
e - ""
...
...
o - ""
e - ""
o - ""
e - ""
...
...
To copy to clipboard, switch view to plain text mode
Bookmarks