[Interest] QProcess unbuffered

Björn Schäpers qt-maillist at hazardy.de
Mon Mar 6 21:17:39 CET 2023


Am 06.03.2023 um 02:11 schrieb Scott Bloom:
>
> I have an external executable (mkvalidator from 
> https://www.matroska.org/downloads/mkvalidator.html
>
> It never flushes the output, and it uses linefeed without carriage returns to 
> overwrite existing text on the output.
>
>
> The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get 
> zero output until the process ends.  As if it was buffered, and the output was 
> finally flushed
>
> When running from the command line, I do get output continuously during the 
> processing.
>
> I setup a timer to waitForRead, didn’t do anything. I cant seem to force the 
> QProcess to read all stdout or stderror info.
>
> Any thoughts?
>
>
> TIA
>
> Scott
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
Hi,

I had the exact same problem (but without QProcess). You have to use a trick to 
disable the buffering, I don't know if its possible with QProcess, you will have 
to use QProcess::CreateProcessArgumentModifier or most likely CreateProcess 
directly.

If there is interest I can copy some of my data, but currently I can't access it.

Kind regards,
Björn.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230306/715d4c05/attachment.htm>


More information about the Interest mailing list