title: Qt: QProcess to call terminal + script
body: <p>I am having real trouble with the use of QProcess, I've looked at several locations to use it, but everytime I use it my program freezes, or it just doesn't do what I want it to do.</p>
  
  <p>What I want to do from my GUI application is the following:</p>
  
  <p>Change directory to /Users/Tim/etc etc.
  From there I need to call gnuplot and load a script into it.</p>
  
  <p>What I'd normally would do in a terminal window is the following:</p>
  
  <pre><code> &gt; cd /Users/Tim/...        
   &gt; /opt/local/bin/gnuplot barchartscript.txt
  </code></pre>
  
  <p>At the moment I'm using system call to do this, and that works, but everybody recommends using QProcess, and so I would like to do that.</p>
  
  <p>How my code looks now with QProcess:</p>
  
  <pre><code>    QObject *parent;
      QProcess *process = new QProcess(parent);
      QString commands;
      QString changed = "cd /Users/Tim/etcetc";
      commands = (changed + "&amp;&amp; /opt/local/bin/gnuplot scatterplotscriptwithout.txt").c_str();
  
      process-&gt;start(commands);
  </code></pre>
  
  <p>Can anybody tell me what's wrong? Or the correct way to do multiple commands in one process?</p>