This snippet may be useful (untested). Refer to QProcess documentation for detail on each method.
process->setWorkingDirectory("/Users/Tim/etcetc");
process->setArguments(QStringList() << "scatterplotscriptwithout.txt");
process->start("/opt/local/bin/gnuplot");
EDIT
Another thing that seem wrong in your program is the undefined pointer that you give as parent to your QProcess instance. It is useful to set a parent to take benefit of an automatic children deletion. In this case, just take care to delete the QProcess instance yourself.
EDIT 2 (error handling)
QProcess *process = new QProcess;
connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(handleError(QProcess::ProcessError)));
Then define a proper slot (here handleError)
void MyClass::handleError(QProcess::ProcessError error) {
switch(error) {
case QProcess::FailedToStart:
qDebug() << "Failed to start, may be due to insufficient permissions";
break;
case QProcess::Crashed:
qDebug() << "Program crashed.";
break;
//debug each case..
}
}
See here for a detail of all the enum values.
If your QProcess ends correctly but not with the expected output, you can look at the exit code of your process and refer to the gnuplot man page for information.