title: Qt- using getline function
body: <p>I am using Qt 5.2.1 and here is part of a function that I want to use in my program -</p>
  
  <pre><code>while( getline(in,str,':')
  {
  getline(str,'\n');
  int var = atoi(str.c_str());
  }
  </code></pre>
  
  <p>my question is how can I implement this in qt? </p>
  
  <p>I searched the docs a bit and found out about readline and split but I dont know how to use them</p>
  
  <p>any help is much appreciated. :D</p>
  
  <p>Edit - my first getline checks for ':' in the text file and the second one picks up the number (that comes after ':') and converts it into a integer and stores it in a variable.</p>
  
  <p>2 edit :</p>
  
  <p>Here's how my text file looks like...</p>
  
  <p>500 - 1000  : 1</p>
  
  <p>1000 - 1500 : 2</p>
  
  <p>1500 - 2000 : 7</p>
  
  <p>2000 - 2500 : 6</p>
  
  <p>the 1, 2, 7, 6 are the values that I need in my program</p>