Menu

#288 Gunplot as QProcess

open
nobody
None
5
2023-11-07
2023-11-07
No Za
No

Hi,
I start Gnuplot as a QProcess

Gpt = new QProcess();
arg << "-s" << "<&0";
 Gpt->setArguments(arg);
 Gpt->setProcessChannelMode(QProcess::SeparateChannels);
 connect(
           Gpt,&QProcess::readyReadStandardError,
           this,&GpObj::ReadError);
    connect(
           Gpt,&QProcess::readyReadStandardOutput,
           this,&GpObj::ReadStdOut);
 Gpt->start("c:/cygwin64/bin/gnuplot-X11");

so far so good.

My problem is that only STDERR seems to be used for any output from gnuplot.
If I try to gather information eg. by print MOUSE_X," ",MOUSE_Y I have to check that this is the correct output and not an error from a preceding plot command, eg format error etc.
It would be really helpful if errors would go to STDERR while normal output goes to STDOUT
In this case eg. it is much easier to filter out "Press return for more: " during the help command and present the full text at once.

Is there a way to make gnuplot believe to be started interactively ? Or the other way around how to gnuplot detect that it is not called from bash ?

Discussion

  • Hans-Bernhard Broeker

    See "help set print"

     
  • No Za

    No Za - 2023-11-07

    Thanks, this solves print to STDOUT!
    But the other question, regarding how GP detects in which mode it is started, is not answered.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.