C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Detect non overriden function

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 21 Mar 2022 21:42:40 -0300
On Monday, 21 March 2022 14:25:57 -03 organicoman wrote:
> Yes,
> If QProcess receives writes on its standrdError channel, and you set your
> channel to be standardOutput, calling readAll won't return a thing. That's
> why, i guess, they added two methods:
> readAllStandardError
> readAllStandardOutput

It's perfectly fine to call readAll(), and it's documented it will read the
default channel. You can choose another channel or you can tell QProcess to
merge the channels. In summary, there's nothing wrong with using readAll().

> From its name, it sounds that it reads anything available no matter what
> channel you are on. Which obviously does not.

That's not what it's meant to do and the documentation is clear that they are
separate and you can toggle between them.

https://doc.qt.io/qt-6/qprocess.html#communicating-via-channels

> Help the implementer communicate his intentions using warnings, annotations,
> attributes, to expose his design to the users, get feedback, refine the
> implementation. No one can guess all the scenarios of usage of his library.

We're still talking about modifying the class in question. If you have
suggestions for new attributes that can help convey this message, then you can
propose them to the standard.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2022-03-22 00:42:44