[Qt-interest] How to get an icon associated with a certain filetype using Qt?

Robert Hairgrove evorgriahr at hispeed.ch
Wed Mar 24 08:52:49 CET 2010


André Somers wrote:
> Ah, sorry, I missed that. In that case, the issue is rather more challenging
> indeed... It would be nice if the interface would be extended with an option
> to query based on mimetype, but that does not help you now. I am afraid
> you'll need to resort to platform dependent code, just like Qt itself does.
> Perhaps studying the sources of QFileIconProvider will help you get what you
> want. I just looked, and at least for windows it seems to use the file
> extension. Do you happen to have the file name too?

The file name is usually present. Thanks for the information on 
QFileIconProvider, I'll have a look at the source code and see what I 
can do. Maybe it will work when I use the file name, even though the 
file doesn't actually exist.



More information about the Qt-interest-old mailing list