I can see three options:
  • Write your gnuplot commands to a temporary file and execute:
    Qt Code:
    1. system("gnuplot <tempfilename");
    To copy to clipboard, switch view to plain text mode 
    You can use mkstemp (3) or QTemporaryFile to get a safe temporary file.
  • Open gnuplot using QProcess and write your gnuplot commands to the sub-process input stream that QProcess provides.
  • popen (3) gnuplot and use the FILE handle returned to write your gnuplot commands before pclose (3)