title: Qt C++ Convert QString to long
body: <p>I'm trying to convert QString into long using this commands:</p>
  
  <pre><code>        QTextStream stream(&amp;file);
          QString content = stream.readAll();
          qDebug() &lt;&lt; "String: " &lt;&lt; content;
          bool ok;
          long long a = content.toLong(&amp;ok, 10);
          qDebug() &lt;&lt; a;
          file.close();
  </code></pre>
  
  <p>But I get following output from qDebug:</p>
  
  <pre><code>String:  "123451234512345
  " 
  0 
  </code></pre>
  
  <p>It seems this qstring can't be converted into long long variable because I always get 0. I tried to convert smaller number like 1234 and it works, but when I try to convert this big number then I have problems. Please help</p>