PDA

View Full Version : "Icon grid"



pippo42
12th January 2010, 16:46
Hello,

How could I make an "icon grid"?

I do not know how to say it better. I would like to set icons or simply labels on a grid. The aim is to have something that looks like, for example, the contents of a folder displayed in konqueror where every file appears as an icon. I would also need these elements to be clickable.

I have found no easy way to do this but I assume that there must be a simple way to do it.

Thank you!

high_flyer
12th January 2010, 16:58
use QGridLayout.

pippo42
12th January 2010, 18:06
Thank you!

Initially, I had done it with QGridLayout but I was hoping (without being able to find it) that there would be something more simple where I could just "throw" the items I wanted to display and that their organisation would be automatic in case the use resized the window for example.

faldzip
12th January 2010, 18:59
Use QListView with your model (like QStandardItemModel or your own implementation) or QListWidget and use QListView::setViewMode() to set the mode to QListView::IconMode.

pippo42
13th January 2010, 08:21
Thanks!

I had used QtAssistant and searched in google but did not find what I needed.

I have reached the same conclusion as you did. I am now doing it in a QListWidget and icons. That way, the layout of the entries will be nicely set up automatically.