title: problem with QProcess whitspaces and arguments
body: <p>I want to call an executable via a QProcess. The path to the executable can contain whitespaces. Therefore I put quotations around the path to the executable. </p>
  
  <p>However, this only works as long as I do not add any arguments. </p>
  
  <p>The following code reproduces the problem:</p>
  
  <pre><code>#include &lt;QCoreApplication&gt;
  #include &lt;QProcess&gt;
  #include &lt;QDebug&gt;
  #include &lt;QDir&gt;
  
  int main(int argc, char *argv[])
  {
      int i = 0; // no whitespace, no argument -&gt; works
      //    int i = 1; // whitespace with quotation, no arguments -&gt; works
      //    int i = 2; // no whitespace, arguments -&gt; works
      //    int i = 3; // whitespace with quotation, arguments -&gt; works not
  
      QCoreApplication a(argc, argv);
  
      QProcess *process = new QProcess();
  
      QString pathToFile;
      QString absolutePathToProgram;
      pathToFile = "/home/user/tmp/file.xml";
  
      if (i == 0){
          absolutePathToProgram = "/home/user/tmp/executable";
      }else if(i == 1){
          absolutePathToProgram = "/home/user/tmp whitespace/executable";
          absolutePathToProgram = "\"" + absolutePathToProgram + "\"";
      }else if(i == 2){
          absolutePathToProgram = "/home/user/tmp/executable";
      }else if(i == 3){
          absolutePathToProgram = "/home/user/tmp whitespace/executable";
          absolutePathToProgram = "\"" + absolutePathToProgram + "\"";
      }
  
      QStringList arguments;
      arguments &lt;&lt; pathToFile;
  
      if (i==0 || i==1){
          process-&gt;start(absolutePathToProgram);
      }else{
          process-&gt;start(absolutePathToProgram,arguments);
      }
  
      process-&gt;waitForFinished();
  
      QString output(process-&gt;readAllStandardOutput());
  
      qDebug() &lt;&lt; output;
  
      return a.exec();
  }
  </code></pre>
  
  <p>I have added 4 cases:</p>
  
  <ul>
  <li><code>i == 0</code>: path to executable does not contain whitespaces and we do not pass arguments. This works</li>
  <li><code>i == 1</code>: path to executable does contain whitespaces and we do not pass arguments. This works</li>
  <li><code>i == 2</code>: path to executable does not contain whitespaces and we do pass arguments. This works</li>
  <li><code>i == 3</code>: path to executable does contain whitespaces and we do pass arguments. This does not work</li>
  </ul>
  
  <p><strong>Why is case <code>i == 3</code> not working?</strong> </p>
  
  <p>I'm using Ubuntu as an operating system.</p>
  
  <p><strong>BONUS:</strong></p>
  
  <p>I also need to get it working on Windows. Usually, on Windows, I start the program with:</p>
  
  <pre><code>process-&gt;start("cmd.exe", QStringList() &lt;&lt; "/c" &lt;&lt; absolutePathToProgram &lt;&lt; pathToFile);
  </code></pre>
  
  <p>I didn't have the time to test it on windows but if someone posts an answer and also knows how to create a solution on windows please let me know. </p>