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

André Somers andre at familiesomers.nl
Tue Mar 23 19:22:26 CET 2010


Hi,

How do you figure that? Based on the short list of enumerated in IconType?
If you actually try it, you see that it uses the system icon for the icons
you ask for using a QFileInfo. Wouldn't that be enough? Or don't you have an
actual file of the type you are after?

André

-----Oorspronkelijk bericht-----
Van: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] Namens Robert Hairgrove
Verzonden: dinsdag 23 maart 2010 16:26
Aan: qt-interest at trolltech.com
Onderwerp: Re: [Qt-interest] How to get an icon associated with a certain
filetype using Qt?

Scott Aron Bloom wrote:
> QFileIconProvider works very well
> Scott

Thanks ... I looked at this class, too. But it looks like there is a 
very limited selection of icon types available.  Maybe I'll just roll my 
own icon database for the most common types.

The problem is that I need to get an icon based on an attachment's MIME 
type, or perhaps from any file name extension, and not from the file 
itself. At the point in time when I need the icon, the attachment is 
still wrapped up in the email file, usually as a long sequence of 
base64-encoded text data.

Maybe there is still another way?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest





More information about the Qt-interest-old mailing list