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.
Ex:
value1 = 2.4567
value2 = 1.34577
value3 = 10.76546
value4 = 11.45454
Result of Ascending order:
1.34577
10.76546
11.45454
2.4567, which is correct because of string compare, but numerically wrong.
Ex:
value1 = 2.4567
value2 = 1.34577
value3 = 10.76546
value4 = 11.45454
Result of Ascending order:
1.34577
10.76546
11.45454
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.
Ex:
double nValue = value.toDouble();
//nValue = 34.5634
Can you let me know how should i maintain the precision and to do ordering numerically
in table model.
Ex:
QString value = 34.5634098790;
double nValue = value.toDouble();
//nValue = 34.5634
Can you let me know how should i maintain the precision and to do ordering numerically
in table model.
To copy to clipboard, switch view to plain text mode
Bookmarks