title: Getting different values from std::stod() and QString::toDouble() in Qt5
body: <p>I started a Qt project and linked to it some C++ code I wrote to parse a file. This code is using std::stod() to parse double values, and works fine in a plain c++ project, but when used with a Qt application, std::stod() returns only the integer part of the number.</p>
  
  <p>I wrote and ran some test code, one compiled with g++ 6.1, and the other with qmake 5.6 and the same g++. The results are the same as my projects results.</p>
  
  <p>code compiled with g++ :</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  
  int main(int argc, char ** argv)
  {
    const std::string number("3.14");
    double dbl = std::stod(number);
  
    std::cout &lt;&lt; dbl &lt;&lt; '\n'; // 3.14
  
    return 0;
  }
  </code></pre>
  
  <p>It shows the good value : <code>3.14</code> </p>
  
  <p>code compiled with Qt :</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;QCoreApplication&gt;
  #include &lt;QDebug&gt;
  #include &lt;iostream&gt;
  
  int main(int argc, char *argv[])
  {
      QCoreApplication a(argc, argv);
  
      const std::string snumber("3.14");
      const QString qnumber = QString::fromStdString("3.14");
  
      double std_d = std::stod(snumber);
      double qt_d  = qnumber.toDouble();
  
      qDebug() &lt;&lt; std_d &lt;&lt; qt_d;                 // 3 3.14
      std::cout &lt;&lt; std_d &lt;&lt; ' ' &lt;&lt; qt_d &lt;&lt; '\n'; // 3 3.14
  
      return a.exec();
  }
  </code></pre>
  
  <p>Can you tell me why std::stod() behaves like this ?</p>