PDA

View Full Version : Adjust Icons of images according to its gridsize or vice-versa in QlistWidget.



Dev
1st March 2013, 10:10
Hello,

I am using Qlistwidget in my application. I want to adjust the size of the icons of the images of different sizes in the grid of Qlistwidget. i have tried setGridSize() function but it changes the size of all the items in widget. I want the size according to the size of icons. So please help me. I will
really appreciate your help.

wysota
1st March 2013, 11:55
I think you need to provide a custom delegate for this that will calculate the decoration size based on its real size and will draw it accordingly. But first you might try setting the iconSize() property of the list widget to an invalid size. I doubt it will help but it is worth to try.