[PyKDE] Sorting a qlistview

Derek Fountain derekfountain at yahoo.co.uk
Tue Oct 28 06:42:01 GMT 2003


I have a qlistview with 2 columns and a set number of rows. I've filled in the 
row names into column 0 in designer; my code now just fills in the values in 
column 1 when it gets the information.

The problem is the qlistview is defaulting to having sorting on column 0. The 
code pyuic generates puts my row names in, and they get sorted 
alphabetically. I want them to stay in the places I've arranged using 
designer!

If I modify the pyuic generated code and drop a setSorting( -1 ) in there 
before my rows are added, it works as I want. But modifying that code isn't a 
good idea...

Short of manually adding my rows in the constructor (there's about 50 of 
them!) is there anything I can do to persuade designer/pyuic to leave the 
qlistview unsorted from the outset?

-- 
> eatapple
core dump




More information about the PyQt mailing list