title: How to read numbers in a file and process them as integer in Qt
body: <p>I have a file which consists of free space size of the drives and devices like the following:
  32591253504, 33591253504, and so on. I wanted to save these numbers in integer form and then convert them to gigabytes. How can I do that in Qt? I have written the following program which stores numbers as a QString and then represents them in QTableView.</p>
  <pre><code>// Get free space of the Drives and Devices
      QFile text_file_freespace(&quot;C:/Users/lightning/Desktop/space.txt&quot;);
      text_file_freespace.open(QFile::ReadOnly);
      QTextStream text_stream_freespace(&amp;text_file_freespace);
      QStringList string_list_freespace;
  
      while (true)
      {
          QString line = text_stream_freespace.readLine();
          if (line.isNull())
              break;
          else
              string_list_freespace.append(line);
      }
  
      row = 0;
      while(row &lt; counter)
      {
          for(int i = 0; i &lt; counter; i++)
          {
              QModelIndex index = model-&gt;index(i, 3, QModelIndex());
              QString freespace = string_list_freespace.at(i+1);
              model-&gt;setData(index, freespace);
          }
          row = row + 1;
      }
  </code></pre>
  <p>How can I process those numbers as integers and then convert them to gigabyte format?</p>