Hi,

I store the list of QString , and i need to populate the QStandardItemModel. Here if i put the values as QString then the 'sort' on the column occurs by string comparision, as a result my decimal numbers arrange by string comaparision and the result of the QT::Ascending or QT:: Descending turns out to be wrong.
Qt Code:
  1. Ex:
  2. value1 = 2.4567
  3. value2 = 1.34577
  4. value3 = 10.76546
  5. value4 = 11.45454
  6.  
  7. Result of Ascending order:
  8. 1.34577
  9. 10.76546
  10. 11.45454
  11. 2.4567, which is correct because of string compare, but numerically wrong.
To copy to clipboard, switch view to plain text mode 
Or if I put the values in Model by converting into double the range of the values are not coming properly. The 12 digit double is coming as 6 digit.

Qt Code:
  1. Ex:
  2. QString value = 34.5634098790;
  3. double nValue = value.toDouble();
  4.  
  5. //nValue = 34.5634
  6.  
  7. Can you let me know how should i maintain the precision and to do ordering numerically
  8. in table model.
To copy to clipboard, switch view to plain text mode