PDA

View Full Version : Two-lined QlistItem



Guilo
15th June 2010, 15:14
Hi !

I am about to use a QListView to display some elements in my application. But I don't know where to seek for a "two-lined" qstandarditem to put in my list. Here is attached what I am looking for. I want the item to have text on 2 lines ad have different fonts on these two lines.

With QItemDelegate ? Or is QListView not a good idea ?

Thanks

Lykurg
15th June 2010, 15:44
amarok is open source, so you can just look there how they did it. I would go for a custom delegate.

Guilo
15th June 2010, 15:52
I'll have a look but there are a lot of files in the amarok tarball...
EDIT : Found it, it is called PrettyItemDelegate but I have no idea what to put in the paint() method (it is not editable), two qlabels ?

Thanks

aamer4yu
16th June 2010, 06:42
EDIT : Found it, it is called PrettyItemDelegate but I have no idea what to put in the paint() method (it is not editable), two qlabels ?
2 Qlabels..nooo. You just need to drawText in 2 lines..