PDA

View Full Version : questions on QListView



ber_44
25th July 2007, 07:35
I want a listview that shows
a red separator between logical groups in the listview (i.e. only between certain records).
Can you give me direction what functions to use/reimplement for this?
[my other question--that I edited out--was about word wrapping]

marcel
25th July 2007, 07:39
Use a QListView and create your own item delegate.
Also, you should have two types of items: normal and section separators.

You should differentiate between items with roles.

The delegate will paint a section separator as a red line, while the delegate will paint a normal item as you require it: with word wrap, etc. Just be careful to set the correct size hints.

Regards

ber_44
25th July 2007, 07:42
I just realized that there was a similar discussion:
http://www.qtcentre.org/forum/f-qt-programming-2/t-qlistview-word-wrap-7278.html
Thanks for the hint.

ber_44
25th July 2007, 09:03
I did try using this:
http://www.qtcentre.org/forum/f-qt-programming-2/t-qlistview-word-wrap-7278.html#td_post_38948
But see the results attached. Any ideas? I'm using Mac right now.