PDA

View Full Version : QIcon and System Icons



tntcoda
8th January 2009, 21:28
Hi,

I have a QTreeWidget control, displaying various file names that don't exist on the system. Is there any possible way to load the system icon into a QIcon for a specific file type?

For example, say i have a string in my QTreeWidget "myfile.cpp" can I load the system icon associated with a .cpp file into a QIcon to display in the QTreeWidget?

Probably a long shot, but i really hope its doable :)

Thanks very much,

Jack

riklaunim
8th January 2009, 23:21
On Linux/Unix you could look at XDG desktop specs (for PyQt - pyxdg). On other OS I don't know. You would have to load the icon from the folder where system keeps it's icons by hand (or with the help of MIME detection).