i need sort by columen of qtableview,but qtableview sort by char ,but i need sory by int,
for example:
a columen data is : 1, 2, 10 , it is 1,10,2 if sort by char,but i need 1,2,10 .
can somebody holp me? thanks
i need sort by columen of qtableview,but qtableview sort by char ,but i need sory by int,
for example:
a columen data is : 1, 2, 10 , it is 1,10,2 if sort by char,but i need 1,2,10 .
can somebody holp me? thanks
Are you using QSortFilterProxyModel ?
If yes you need to override QSortFilterProxyModel::lessThan ..
if you are not using QSortFilterProxyModel you must be using some model...
You will need to override QAbstractItemModel::sort.
But it will be preferable that you use QSortFilterProxyModel and override the lessThan function. You wont have to alter your model![]()
Bookmarks