How do I read external file that returns me the output with each index values.
The index values are : 0 to 3;
I want to read the output from "testFile" with index. The bash file "testFile" executes with index values like this:
Qt Code:
  1. ./testFile 1
  2. output:-" This is my test1"
  3.  
  4. ./testFile 2
  5. output:-" This is my test2"
  6.  
  7.  
  8. ./testFile 3
  9. output:-" This is my test3"
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void CMainView::ReadFileValue()
  2. {
  3. QProcess * process;
  4. process = new QProcess(this);
  5.  
  6. //Add the argument of the process
  7. process->addArgument( "/bash" );
  8. process->addArgument ("testFile");
  9.  
  10. connect(process, SIGNAL(readyReadStdout()), this, SLOT(readTestFileOut()));
  11.  
  12. if (!process->start())
  13. {
  14. qDebug("Error with process");
  15.  
  16. }
  17. }
  18. void CMainView::readTestFileOut()
  19. {
  20. QString str = process->readStdOut();
  21. //str prints only first line i.e." This is my test1"
  22. //I want to achieve like below:-
  23. lineEdit1->setText(str1); //str1 would be This is my test1
  24. lineEdit2->setText(str2); //str2 would be This is my test2
  25. lineEdit3->setText(str3); //str3 would be This is my test3
  26.  
  27. }
To copy to clipboard, switch view to plain text mode