Results 1 to 5 of 5

Thread: Qprocess for a prompted program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qprocess for a prompted program

    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:
    Qt Code:
    1. process::process(QString progname)
    2. {
    3. progname="gnuplot";
    4. program=new QProcess;
    5. program->start(progname,QIODevice::ReadWrite);
    6. qDebug()<<program->isWritable();
    7. // program->execute(proc);
    8. qDebug()<<"paso execute";
    9.  
    10. program->write("plot sin(x) pause -1");
    11. qDebug()<<"paso plot";
    12. }
    To copy to clipboard, switch view to plain text mode 

    I added the start function because it wasn't writable without it.
    Last edited by muzgash; 10th May 2009 at 13:25.

Similar Threads

  1. Replies: 1
    Last Post: 1st December 2008, 21:02
  2. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  3. QProcess start a console program
    By Shawn in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2007, 12:38
  4. QProcess problem (Main program hangs)
    By sincnarf in forum Qt Programming
    Replies: 5
    Last Post: 11th October 2007, 09:26
  5. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.