Results 1 to 4 of 4

Thread: How to set default icons of different file types?

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default How to set default icons of different file types?

    Hi all

    Can anybody know is there any class or function in Qt through which, It recognises the file type and sets icon of the file to the respective file type.

    for eg. If there is a PNG file , then it set icon of the PNG file, in front of that file.
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set default icons of different file types?

    You need to implement your own QFileIconProvider.

  3. The following user says thank you to wysota for this useful post:

    merry (2nd June 2008)

  4. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: How to set default icons of different file types?

    Thanx 4 the reply

    Actually i am having a TreeWidget of Files and folders.

    And these required every time the path of the file or folder whose Icon is to be used.

    But I want to do like this that suppose If I add some files say

    image.jpeg , Image1.gif, Image2.png ,Image4.bmp ,Music.mp3, Movie.avi then it should automatically show the Icon of the particular file.

    Is it possible to do?
    Always Believe in Urself
    Merry

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set default icons of different file types?

    Still you need to create an appropriate file icon provider and query it for icons. Of course you can also do that manually by checking filename suffixes and creating icons yourself.

Similar Threads

  1. How to load icons from resource file
    By joseph in forum Qt Programming
    Replies: 7
    Last Post: 25th June 2012, 08:00
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 07:51
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 16:21
  4. A file browser that uses the native OS icons
    By calin_iaru in forum Newbie
    Replies: 1
    Last Post: 21st May 2007, 13:14
  5. Opening swf file in the default browser
    By munna in forum Qt Programming
    Replies: 16
    Last Post: 5th May 2006, 10:33

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.