[Qt-interest] QFileSystemModel some questions

Andreas Pakulat apaku at gmx.de
Fri Apr 3 20:59:07 CEST 2009


On 03.04.09 20:56:14, Alex Custov wrote:
> 1) How to show system-wide MIME icons for files? Currently all of them
> are blank. Directory icons seems to work, but all files have blank
> icons.

Implement a lookup to find out the mimetype for an icon and then supply
the needed icons with your app (or check wether the OS helps you with
the icons). Qt doesn't have any support that, the icons for directories
are most probably hardcoded and shipped by Qt.

> 2) How to always show directories first (say in QTreeView)?

Create a proxy model on top of the filesystem model that creates the
order as you want it.

> 3) How to use 48x48 icons in QListView with QFileSystemModel? I set
> "iconSize" to 48x48 and "gridSize" to 60x60, but the icons are still
> 16x16 (the grid became bigger, but MIME icons are still 16x16).

The reason is most probably that the model simply supplies QIcon()'s
that are only 16x16. You'll have to change the filesystem model to
supply differently sized icons.

Andreas

-- 
Today is the tomorrow you worried about yesterday.



More information about the Qt-interest-old mailing list