title: QString line.split
body: <p>I am having trouble with split function on QT. I have a text file and the very first line is like this:</p>
  
  <pre><code>10,100;100,100;100,100;100,200;100,200;300,200;300,200;300,350;300,350;250,350;250,350;250,300;250,300;200,300;200,300;200,400;200,400;10,400;10,400;10,100
  </code></pre>
  
  <p>Here every two numbers represents a point with x an y values and semicolons divides the points. After every semicolon there is a new point.</p>
  
  <p>What I want to do is split these numbers element by element like;</p>
  
  <p>Element 0: 10 <br>
  Element 1: 100 <br>
  Element 2: 100 <br>
  Element 3: 100 <br>
  ...</p>
  
  <p>I have managed to do this but there wasn't any semicolons or colons in the text file. </p>
  
  <p>First line of the text file:</p>
  
  <pre><code>10 100 100 100 100 200 300 200 300 350 250 350 250 300 200 300 200 400 10 400 10 100
  </code></pre>
  
  <p>This is how i did it:</p>
  
  <pre><code>void Dialog::readFile()
  {
      QFile file("/Path/of/the/text/file/Data.txt");
  
      if(!file.open(QIODevice::ReadOnly)) {
          QMessageBox::information(0, "info", file.errorString());
      }
  
      QString line = file.readLine();
      qDebug() &lt;&lt; "line:" &lt;&lt; line &lt;&lt; "\n";
      QStringList list = line.split(" ");
      double element;
  
      for(int i = 0; i &lt; list.size(); i++) {
          element = list.at(i).toDouble();
          points_.append(element);
          qDebug() &lt;&lt; "element:" &lt;&lt; element &lt;&lt; "\n";
      }
  }
  </code></pre>
  
  <p>Output of this code is:</p>
  
  <pre><code>line: "10 100 100 100 100 200 300 200 300 350 250 350 250 300 200 300 200 400 10 400 10 100\r" 
  element: 10 
  element: 100 
  element: 100 
  element: 100 
  element: 100 
  element: 200 
  element: 300 
  element: 200 
  ....
  </code></pre>
  
  <p>I want to do this exactly the same way. Is there any suggestion?</p>
  
  <p>PS: I am new on QT so please consider this.</p>