Hi
I want to have QTableWidget sorted according to polish language. I have the parent window set to polish/Poland but QTableWidget is sorting wrong. What should I set else ?
thanks
Ryszard
Hi
I want to have QTableWidget sorted according to polish language. I have the parent window set to polish/Poland but QTableWidget is sorting wrong. What should I set else ?
thanks
Ryszard
what do you mean by
How did you do that?I have the parent window set to polish/Poland
Show us some code, please.
You may reimplement QTableWidgetItem::operator<() if you want to have custom sorting.
J-P Nurmi
I can see that in properties table of window in Designer. locale: language:Polish, country:Poland.
I thik this is default setting in my system.
But I also tried add
setLocale(QLocale(QLocale::Polish,QLocale::Poland) );
into constructor of my window. Without effect.
Do what J-P suggested. You are observing the effect because the sorting is based not on the widget that displays the content, but on QString that is kept in the model that the widget uses and QStrings are compared according to C locale. You need to compare using QLocale to have the proper order.
Bookmarks