title: Qt - How to count number of line in .txt file
body: <p>I want to count number of line in text file, so i can convert it to two dimensional array</p>
  
  <p>The text file should be like this</p>
  
  <pre><code>20
  30
  78
  1000
  ....
  ....
  </code></pre>
  
  <p>and source code using QFile to access file</p>
  
  <pre><code>QFile file("c:/Qt/in.txt");
  file.open(QIODevice::ReadOnly); //| QIODevice::Text)
  y = linecount/5;
  QString line[y][5];
  QTextStream in(&amp;file);
  for (int k=0;k&lt;=y;k++)
  {
      for (int x=0;x&lt;=4;x++)
      {
          line[i][x] = in.readLine();
      }
  }
  </code></pre>