If you sorting with String the result will not get like Integer.
from 1-9 it sort well but after 9 the result like this
3
2
12
11
10
1
0
If possible can you send me the snippets of the code.It would be great help for me.
If you sorting with String the result will not get like Integer.
from 1-9 it sort well but after 9 the result like this
3
2
12
11
10
1
0
If possible can you send me the snippets of the code.It would be great help for me.
[QUOTE][from 1-9 it sort well but after 9 the result like this/QUOTE]
One way of overcoming this is by adding '0's like that:
001
002
020
100
Then the strings will sort correct for the integers.
The other way is as I said, to subclass QTableWidgetItem.
[QUOTE][If possible can you send me the snippets of the code./QUOTE]
Snippets of what code?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
another method would be to use a table model so you have access to the integer data, sort that, and then in your 'data' method, you would convert the integer data to string data to be displayed by the table.
Bookmarks