Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119804

QProcess needs a waitFor to wait for either channel in QProcess::SeparateChannels

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.0
    • None
    • All

    Description

      Let's say in this report my process channel mode is set to QProcess::SeparateChannels.

      I'm running a process, which may output the data on stdOut and / or stdErr. I can't predict the order of the data sent, of course. It may happen, that I receive the data only on one of these channels, while the other is empty.

      Calling QProcess::waitForReadyRead() in this case is useless, as it seems this works only with conjunction to the previously selected read channel via QProcess::setReadChannel(). So, if my read channel is set to QProcess::StandardOutput and the process sends the data on stdErr, the QProcess::waitForReadyRead() timeouts with a failure. The same happens in the opposite case: read channel is set to QProcess::StandardError and the process sends the data on stdOut -> QProcess::waitForReadyRead() also timeouts with a failure.

      I see no way to setup the QProcess so that QProcess::waitForReadyRead() reacts to the data received on any channel.

      More info: Utils::Process1 wrapper around QProcess inside Creator makes Utils::Process::waitForReadyRead() to work with data appearing on any channel.

      1: https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/libs/utils/process.h

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              thiago Thiago Macieira
              jkobus Jarek Kobus
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes