Results 1 to 1 of 1

Thread: How to get system associated icon for any file

  1. #1
    Join Date
    Dec 2009
    Posts
    26
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to get system associated icon for any file

    Hi,

    Please suggest me a function which will take a fileinfo as an argument and return the system associated icon for that file. QFileSystemModel has a function fileIcon which is returning icon of any folder correctly, but in case of a file it is always returning same icon for all types of file.

    If currently Qt doesn't have any such function, please help me to write my own function. I know in Windows there is an API function SHGetFileInfo. I only need help for Linux and MacOS.

    [Edited]
    I found that QFileIconProvider did exactly what I wanted. But somehow it is working perfectly only on windows and KDE (I didn't check on MacOS), it is not working on Gnome (In Gnome it is returning default file icon for all types of file. But in case of folder it is working perfectly). Any idea how to get file icon in Gnome?
    Last edited by rittchat; 15th December 2009 at 06:10.

Similar Threads

  1. Replies: 1
    Last Post: 16th November 2009, 08:10
  2. Replies: 5
    Last Post: 5th August 2009, 18:32
  3. Dropping file over app icon in MAC
    By dev_maximaa in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2009, 06:40
  4. How to write some text next to the system tray icon?
    By alex chpenst in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2008, 09:43
  5. set Icon to .app file
    By vishal.chauhan in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2007, 22:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.