I have a LineEdit and want to convert the value to qint64 (long) for some calculation. But I always get a problem and the value return 0. How can I solve it?

Qt Code:
  1. inline long GetInteger64FromStatic(QLineEdit* lineEdit)
  2. {
  3. QString text;
  4. qint64 nValue = 0;
  5. //bool convertOK;
  6. bool ok;
  7.  
  8. nValue = lineEdit->text().toLong(&ok,10);
  9.  
  10. return nValue;
  11.  
  12. }
To copy to clipboard, switch view to plain text mode