PDA

View Full Version : QFileDialog no thumnail view?



sincnarf
13th October 2007, 21:47
Anybody here has ideas how I can implement a QFileDialog with thumbnail view? I can't see a thread like this

marcel
13th October 2007, 21:52
It's ok on Vista. The file dialog is native. so if the platform supports thumbnail views then it should be there.
Have you tested with other applications?

wysota
13th October 2007, 21:52
You can set a custom item delegate on the dialog using QFileDialog::setItemDelegate(). You can render the items as you want there.

marcel
13th October 2007, 22:00
You can set a custom item delegate on the dialog using QFileDialog::setItemDelegate() (http://doc.trolltech.com/latest/qfiledialog.html#setItemDelegate). You can render the items as you want there.

I think it is impossible(or at least a long way) to cover all the file formats that can be previewed by the native window manager.
Maybe he can use delegates to preview image files in supported formats by Qt, but there are previews for pdf, avi, wmv, mpg, etc.

wysota
13th October 2007, 22:06
He asked for a way to implement a thumbnail file dialog, not for a ready solution. One can always use libMagick to generate thumbnails, it supports over 200 formats.

sincnarf
13th October 2007, 22:27
It's ok on Vista. The file dialog is native. so if the platform supports thumbnail views then it should be there.
Have you tested with other applications?

i'm running on ubuntu feisty fawn... no I haven't tested with otherapps.

I'm sorry to both the File dialog will only display images, so I do not need to generate thumbnails for other file extensions (I only want to filter jpeg png gif and bmp)

marcel
13th October 2007, 22:37
Then you can use Wysota's solution, with delegates.

sincnarf
14th October 2007, 01:50
He asked for a way to implement a thumbnail file dialog, not for a ready solution. One can always use libMagick to generate thumbnails, it supports over 200 formats.

Uh, I can't find an example for the item delegates

wysota
14th October 2007, 09:51
Delegate examples are in the itemviews directory. And many delegate threads are available on this forum, just try searching it.