i want to execute this shell command in qt
Qt Code:
  1. sudo ./filename.sh
To copy to clipboard, switch view to plain text mode 
this code executng in terminal,,while in Qprocess i getting error
Qt Code:
  1. /bin/sh: 0: Can't open sudo
To copy to clipboard, switch view to plain text mode 
my code below:
Qt Code:
  1. QProcess process;
  2. bool x;
  3. qint8 status;
  4. x=process.startDetached("/bin/sh", QStringList()<< "sudo "<<"./samp.sh");
  5. qDebug()<<process.readAllStandardOutput();
  6. status=process.waitForFinished();
  7. if(!x)
  8. {
  9. qDebug()<<process.errorString();
  10. }
  11. else
  12. {
  13. qDebug()<<"success";
  14. }
To copy to clipboard, switch view to plain text mode 
after searching i got one solution for sudo which wysota said
http://www.qtcentre.org/threads/3962...commands-linux
Qt Code:
  1. QString apath,program;
  2. apath=QDir("/bin/bash").absolutePath());
  3. program="gksudo";//i used gksudo i getting no answer
  4. args << "apt-get install";
  5. process->start(program,args);
To copy to clipboard, switch view to plain text mode 
how to use sudo commang in Qprocess please give me suggestion for this
Thanks in advance