PDA

View Full Version : How To know the QlistView width to reimplement sizeHint in delegate



JuanMO
18th October 2010, 21:23
Hi,
I want to reimplement sizeHint in my delegate, to make the item size to:
item width = list width
item height = list width * 0.16
for example, is that correct? this size is for all items,

Is there any other way to set the item height?

Regards

Juan M.

wysota
18th October 2010, 21:42
I would probably rather subclass the view and reimplement visualRect() and indexAt().

Lykurg
18th October 2010, 21:44
With the size hint function an option is delivered. The rect variable holds the actual with of your view. So you can work with that. At least that is what I remember right now.

If all your items have the same size, also have a look at setUniformItemSizes().