Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, March 2002
Identifying alternate items in a QListView?


Message 1 in thread

Hello,

I'd like to be able to show alternate items in a QListView with 
different background colours.

I have no problem setting the colours, the problem is deciding which one 
to use. I can easily provide each item with a sequence number as the 
list is populated and use colour 1 or colour 2 in paintCell() for odd 
and even items according to the sequence number but that approach falls 
down when the user changes the sort order of the list.

Can anyone suggest a more inherent method of choosing the list item 
colour that would get around the sorting problem?

-- 
 [ signature omitted ]