Z
Z
ZIK13372020-11-21 13:41:09
PyQt
ZIK1337, 2020-11-21 13:41:09

How to override the sorting of a specific QTableWidget column?

Only certain rows can be present in a column.
There is a set of strings like "yes", "no", "don't know", "absolutely"... - and only such values ​​can be in a column.
It is necessary that the sorting does not go according to the lexicographic order, but in the way I ask.

That is, if I specify that in ascending order it is like this:
absolutely -> no -> don't know -> yes,
then it should sort like this (first there are rows where the values ​​\u200b\u200bin this column are "absolutely", then "no", etc.). e.)
Descending, respectively, in reverse order.

How then do I need to override the sorting of that column?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor T2, 2020-11-22
@ZIK1337

For sorting, we store some values, for displaying others.
https://stackoverflow.com/questions/48496311/how-t...
It's simple.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question