2 Attachment(s)
disable sorting on a QTableWidget
Hi everyone,
I wanted to know if there is an issue to diasble sorting on a QTableWidget, i recieve frames, process them and then put the information in a QTableWidget just like this :
Attachment 12454
if someone click on a column to sort it, it becomes like this :
Attachment 12455
so i want to disable sorting to avoid issues like the second image.
thank's !
Re: disable sorting on a QTableWidget
Quote:
Originally Posted by Qt Documentation
Note that if sorting is enabled (see sortingEnabled) and column is the current sort column, the row will be moved to the sorted position determined by item.
If you want to set several items of a particular row (say, by calling setItem() in a loop), you may want to turn off sorting before doing so, and turn it back on afterwards; this will allow you to use the same row argument for all items in the same row (i.e. setItem() will not move the row).
Turn off the sorting when inserting items, then enable it back.
Re: disable sorting on a QTableWidget
It worked fine.
Thank you !!