Hi
I have some problems with running terminal commands using QProcess. Is there any special way to do it?

Here is my code:
Qt Code:
  1. void MainWindow::on_actionCreate_triggered()
  2. {
  3. p.start("tar -zcvf " + archivename + " " + filenames);
  4. bool success = p.waitForStarted();
  5. ui->textEdit->append(p.readAllStandardOutput());
  6. ui->textEdit_2->append(p.readAllStandardError());
  7. if(success)
  8. {
  9. std::cout << "tar -zcvf " + archivename.toStdString() + " " +
  10. filenames.toStdString() << std::endl;
  11. }
  12. p.terminate();
  13. }
To copy to clipboard, switch view to plain text mode 

My output:
Starting /Users/olivia/....app/Contents/MacOS/wtorek...
tar -zcvf archive.tgz *.h *.cpp
Of course I have tar and in Terminal.app everything is working.
I have Qt 4.7.2.