title: How to use QTextStream::readLine function?
body: <p>I am trying to read values from a text file using the Qt code given below.</p>
  
  <pre><code>int ReadFromFile(QString fileName)
  {
     QFile file(fileName);
     if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
        return 1;
  
     QTextStream in(&amp;file);
     while (!in.atEnd())
     {
        QString line = in.readLine(1); //read one line at a time
        QStringList lstLine = line.split(",");
     }
     file.close();
     return 0;
  }
  </code></pre>
  
  <p>The content of the text file is as follows:</p>
  
  <pre><code>1,0.173648178  
  2,0.342020143  
  3,0.5  
  4,0.64278761  
  5,0.766044443  
  6,0.866025404  
  </code></pre>
  
  <p>However readLine always returns one character at a time but my intention is to read one line at a time and to split each line to get the individual comma seperated values.</p>
  
  <p>Am I missing something basic here?</p>