PDA

View Full Version : QScrollArea not displaying large number of images



lpkincaid
30th May 2009, 16:04
I have a custom widget for displaying thumbnail images. The widget stops displaying when there is a large number of images.

1. The widget is a subclass of QScrollArea
2. A QFrame widget is instantiated and is set as the main scroll widget
3. A QGridLayout widget is instantiated and is the main layout widget
4. For each thumbnail image, a QLabel is created and added to the grid layout. Currently there is only one row with 0..n columns. THe rowSpan and columnSpan size is 3
5. I am adding the label widgets with this call
gridLayout->addWidget( label, row, column, 3, 3);

The images are displayed correctly until the number of images exceeds 40. When attempting to display more images, none of the images are displayed. Is there a scroll area size that needs to be set?

Thanks

wysota
31st May 2009, 09:58
If you set the widgetResizable property to true then the frame would be resized without problems.

By the way, did you think about using QGraphicsView instead of QScrollArea and labels?