Qt5.5.1
QtCreator 3.5.1
Windows 7

Hello,

I'm trying to build a QString for a QProcess command.
I'm getting stray '\' (back slashes) in my output where I try to insert a ".
It appears that I need the " in 'cmd' as there are spaces in the path and file names.
I can't work out how to remove the '\' from the 'cmd' QString (I've tried various variations)
or not to get them there in the first place.
I think its something to do with 'escaping' but not sure what or how.
Help would be appriciated.

Regards
Qt Code:
  1. QString cmd = ("7z x -y ");
  2. cmd.append(fileinfo.fileName());
  3. cmd.append(" *.* ");
  4. cmd.append("-o");
  5.  
  6. cmd.append('"'); //QString output = "Hello \"world\"!"; //string literal - works
  7.  
  8. cmd.append(destination);
  9. cmd.append("/Files to copy");
  10.  
  11. cmd.append('"');
  12.  
  13. cmd.append(" -r");
  14. qDebug() << cmd;
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. qDebug output:-
  2. "7z x -y myFile.zip *.* -o\"H:/my dir/systems/output files\" -r"
  3. ^ ^
  4.  
  5. Terminal commmand, works ok.
  6. 7z x -y myFile.zip *.* -o"H:/my dir/systems/output files" -r
To copy to clipboard, switch view to plain text mode