I am having trouble troubleshooting this problem.

I have a QTimer that calls a slot every second.
The SLOT sends a request to server then receives the html or text and then it gets written to a document.
THen I'm reading the info of this document and pass the values to variables that end up being displayed in a GUI.

Qt Code:
  1. timer = new QTimer(this);
  2. connect(timer, SIGNAL(timeout()), this, SLOT(getValue());
  3. timer->start(1000);
  4.  
  5. ...
  6.  
  7. void myProgram::getValue()
  8. {
  9. myFile = new QFile (filename);
  10. abc = qnetworkaccessmanager.get(QNetworkRequest(url)); //abc is QNetworkReply
  11. connect(abc, SIGNAL(readyRead()), this, SLOT(readValue()));
  12. file->open(QIODevice::ReadWrite);
  13. }
  14.  
  15. void myProgram::readValue()
  16. {
  17. if(file)
  18. file->write(abc->readAll());
  19. file->close(); // maybe not Necessary
  20. file->open(QIODevice::ReadOnly);
  21. if(file)
  22. {
  23. QTextStream in (file);
  24. QString line = in.readLine();
  25. for (int i = 0; i < numberSize(); i++)
  26. {
  27. switch(i)
  28. {
  29. case 0:
  30. { ListofValues.append(line.section(',', 8-i, 8-i)); //ListofValues is QList <QString>
  31. ui->lcdNumber->display(ListofValues[i]);
  32. break;
  33. }
  34. case 1: ... same till case 8;
  35. }
  36. }
  37. }//end if
  38. file.close();
  39. }
To copy to clipboard, switch view to plain text mode 


Now if I refresh the file in a text editor I can see the values change, BUT in my GUI the values don't change they only get the values the very first time the program is called. After that the values don't change but remain the same.

Please any feedback is greatly appreciated I've spent a lot of time on this already.

//sample of file is
1,2,3,4,5,6,7,8,9
so I get the 9 and put it in the first element in Qlist < QString> and so on