Qt-interest Archive, April 2007
Exchanging info between two QProcesses
Message 1 in thread
A parent app is launching two child Qprocesses and I want process A to
transmit some info to qprocess b (Qstring). I know how to transmit from
the child A to the parent (readstdout) but I don't know how the parent
can pass it on to child b. specifically if I use writeToStdin, how does
child b retrieve what the parent wrote into its stdin? How does it know
info is ready and how does it access it?
Thanks,
sb
Message 2 in thread
On 11.04.07 16:31:25, Bono, Saroj CIV NSWC PC wrote:
> A parent app is launching two child Qprocesses and I want process A to
> transmit some info to qprocess b (Qstring). I know how to transmit from
> the child A to the parent (readstdout) but I don't know how the parent
> can pass it on to child b. specifically if I use writeToStdin, how does
> child b retrieve what the parent wrote into its stdin? How does it know
> info is ready and how does it access it?
Well, it reads from stdin or cin (in case you're using std:: to read).
In case child B is a Qt app, you should be able to use
QTextStream input( stdin, QIODevice::ReadOnly);
and then use the input stream (thats Qt4 code).
Andreas
--
[ signature omitted ]