for the search engines...i had the same problem trying to execute gnuplot and writing commands to the QProcess. turns out what i was missing was newlines at the end of each command 
commands << "set datafile commentschars \";\"\n"
<< "set terminal png\n"
<<
QString("set output \"").
append(outfile
).
append("\"\n") << "set multiplot layout 2,1\n"
...
gnuplot.
start("gnuplot",
QIODevice::ReadWrite);
gnuplot.write(cmd.toUtf8());
}
gnuplot.waitForFinished();
commands << "set datafile commentschars \";\"\n"
<< "set terminal png\n"
<< QString("set output \"").append(outfile).append("\"\n")
<< "set multiplot layout 2,1\n"
...
gnuplot.start("gnuplot", QIODevice::ReadWrite);
foreach (QString cmd , commands) {
gnuplot.write(cmd.toUtf8());
}
gnuplot.waitForFinished();
To copy to clipboard, switch view to plain text mode
this code worked for me
Bookmarks