PDA

View Full Version : Thumbnails arranged in a grid



mboeni
21st October 2010, 15:01
Hi all

I need to create an "asset browser" which shows media assets (like images, videos, audio files, etc) in a grid. The grid should consist of thumbnails or static pictures (in the case of a sound file). I would like to choose a fixed size of the thumbnails and when I resize the area - more should be shown (not the thumbnails resized).

I am wondering which combination of widgets for container and asset thumbnail would be the best suited.

Any ideas?

Cheers,
Michael

Lykurg
21st October 2010, 16:14
QListView with IconMode. Or if you need more control use a QGraphicsView, but then you have to take care for all the positioning.

mboeni
21st October 2010, 18:11
Thanks, Lykurg - will try that!

Cheers,
Michael

genjix
23rd October 2010, 10:50
You can also try a gridview with a bunch of QLabels.
QLabel label; label.setPixmap(p); arranged in a grid.

mboeni
2nd November 2010, 12:46
Ah okay - another approach to try out :) Have you done something like that?

Lykurg
2nd November 2010, 21:28
...and you can write your own layout class which arranges widgets in a grid. Most easiest way is same size widgets in a flow layout (which you can find in the documentation).