Re: wrong sort in qtableview
and here we go again. Please use our search engine first before posting! Catchwords "sort number" would have lead you to the solution!
Use QTableWidgetItem::setData() for setting an int value, then the sort will be correct.
Re: wrong sort in qtableview
nice answer thx
but what happend if you have first numbers and after this letters in the same column?
Re: wrong sort in qtableview
Quote:
Originally Posted by
toem
nice answer thx
but what happend if you have first numbers and after this letters in the same column?
split the string in two parts number and text, add two hidden colums to your table and sort after them. Or you have to write your own sort algorithm, if it is too much to duplicate your data...