I tried to put some debug statements to see where it exactly crash. The segmentaion fault does not provide me any information. As soon as I call CreateContorls( ) to call two sequential process my application crash. It never prints any thing else . It looks like Slots readFirstProcess and readSecondProcess never get called otherwise it should print debug statements from slots such as "Print ReadOut Process1".

The output I receive after calling CreateControls() method is :-

Print Statement 1
Print Statement 2
Print Statement 3
Print Statement 4
Print Statement 5
Print Statement 6

But if executes only one process with GetFirstProcess( ) while commenting out second GetSecondProcess() then there is no problem.
Qt Code:
  1. QString CMainTemplate::CreateControls()
  2. {
  3.  
  4. lineEdit->setText(GetFirstProcess());
  5. //lineEdit2->setText(GetSecondProcess());
  6. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. QString CMainTemplate::CreateControls()
  2. {
  3.  
  4. lineEdit->setText(GetFirstProcess());
  5. lineEdit2->setText(GetSecondProcess());
  6. }
  7.  
  8. QString CMainTemplate::GetFirstProcess()
  9. {
  10. process= new QProcess(this);
  11. //Add the arguments
  12. process1->addArgument( "/bash" );
  13. process->addArgument("GetFirstScript");
  14.  
  15. qDebug("Print Statement 1");
  16. connect(process, SIGNAL(readyReadStdout()), this, SLOT(readFirstProcess()));
  17.  
  18. qDebug("Print Statement 2");
  19. if ( !process->start() )
  20. {
  21. qDebug("ERROR: First Process Never Started");
  22. process->deleteLater();
  23. }
  24.  
  25. qDebug("Print Statement 3");
  26.  
  27. return strFirstProcess;
  28. }
  29.  
  30. //...SECOND PROCESS
  31.  
  32. QString CMainTemplate::GetSecondProcess()
  33. {
  34. process1= new QProcess(this);
  35. //Add the arguments
  36. process1->addArgument( "/bash" );
  37. process1->addArgument("GetSecondScript");
  38.  
  39. qDebug("Print Statement 4");
  40.  
  41. connect(process1, SIGNAL(readyReadStdout()), this, SLOT(readSecondProcess()));
  42.  
  43. qDebug("Print Statement 5");
  44.  
  45. if ( !process1->start() )
  46. {
  47. qDebug("ERROR: Second Process Never Started");
  48. process->deleteLater();
  49. }
  50.  
  51. qDebug("Print Statement 6");
  52.  
  53. return strSecondProcess;
  54. }
  55.  
  56. //=====================SLOTS TO READ STD OUT ===================================================
  57.  
  58. void CMainTemplate::readFirstProcess()
  59. {
  60.  
  61. QString str = process->readStdout() ;
  62. strFirstProcess = str;
  63. qDebug("Print ReadOut Process1);
  64. process->deleteLater();
  65.  
  66. }
  67.  
  68. void CMainTemplate::readSecondProcess()
  69. {
  70. QString str = process1->readStdout() ;
  71. strSecondProcess = str;
  72. qDebug("Print ReadOut Process2);
  73. process1->deleteLater();
  74.  
  75. }
To copy to clipboard, switch view to plain text mode