[Qt-interest] How to get an icon associated with a certain filetype using Qt?
André Somers
andre at familiesomers.nl
Wed Mar 24 08:31:30 CET 2010
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?
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 20:38
Aan: qt-interest at trolltech.com
Onderwerp: Re: [Qt-interest] How to get an icon associated with a certain
filetype using Qt?
André Somers wrote:
> 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?
Yes, this is what I was referring to ... the IconType enumeration.
As indicated in my previous messages, I have no file ... all I have at
the point where I need the icon is the MIME type as given in the email
"Content-Type" header. There is no way of knowing in advance whether or
not this file has an associated icon until I decode the base64 (usually
it is in this format) and save it as an actual file on the user's
machine. I'd rather not have to do that unless the user wanted to save it.
_______________________________________________
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