title: I cannot perform math operation on data in qtablewidget cells
body: <p>My OS - Fedora
  QtCreator Qt4.8</p>
  <p>My Qtablewidget has floats in 50 rows in column 2</p>
  <p>I am trying to sum the values in those 50 cells, my return local is 'nan'  I'm puzzled.
  the data looks like this which was generated by the qDebug &lt;&lt; tlocal;</p>
  <p>0
  0<br />
  0
  0
  0.11
  0.062
  0.12
  0.11
  0.21
  0.22
  0.11
  0.15
  0.24
  0.14
  0.046
  0.16
  0.36
  0.14
  0
  0.015
  0.015
  0.13
  0.1
  0.0197
  0.0262
  0.14
  0.04
  0.001
  0.0002
  0.002
  0.00016
  1.18e-05
  2.96e-05
  3.01205e-05
  4.5e-07
  0.001
  5.4e-05
  7.4e-08
  1.71e-07
  4.9e-08
  5.7e-07
  4.9e-07
  1.15e-12
  8.9e-12
  0
  5.6e-05</p>
  <p>My function is here</p>
  <pre><code>float MainWindow::sum_requirements()
  {
      float local;
      float tlocal = 0;
      bool ok;
  
      for (int i=0; i &lt; ui-&gt;tableWidget-&gt;rowCount(); ++i)
      {
  
  
          tlocal = ui-&gt;tableWidget-&gt;item(i, 2)-&gt;text().toFloat(&amp;ok);
  
          qDebug() &lt;&lt; tlocal;
  
          local = local + tlocal;
      }
  
      qDebug() &lt;&lt; &quot;Before return = &quot; &lt;&lt; local;
  
      return local;
  }
  </code></pre>