[Qt-interest] QProcess for a prompted program

Thiago Macieira thiago.macieira at trolltech.com
Thu May 14 08:26:48 CEST 2009


Gerardo Gutierrez wrote:
>I want to run an external program which is prompted (specifically
> gnuplot) and communicate with it writing on his prompt.
>I don't use writeToStdin() function because I'm using Qt4:
>
>
>process::process(QString progname)
>program->start(progname,QIODevice::ReadWrite);
>qDebug()<<program->isWritable();
>// program->execute(proc);
>qDebug()<<"paso execute";
>
>
>program->write("plot sin(x) pause -1");
>qDebug()<<"paso plot";
>}

I think you forgot the newline (\n) after your command.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090514/2fc311f5/attachment.bin 


More information about the Qt-interest-old mailing list