Results 1 to 3 of 3

Thread: How to know file type

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to know file type

    Do not expect Qt to know every possible file type.
    If it's some kind of bitmap you can use QImage or QPixmap to load the file without specifying the format - in that case the loader will try to guess the format by reading the file header and return appropriate value if there's a problem to determine it.

    Edit:
    Forgot to mention that after opening the file you can use for example
    QImage::format().

    Edit2:
    Actually maybe QImageReader::format() would be better
    Last edited by calhal; 16th December 2009 at 13:29.
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

Similar Threads

  1. Replies: 5
    Last Post: 5th August 2009, 17:32
  2. getting a file extenstion list from a MIME type
    By roxton in forum Qt Programming
    Replies: 0
    Last Post: 10th April 2009, 18:27
  3. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  4. dummy question(Error)
    By Masih in forum Qt Programming
    Replies: 12
    Last Post: 19th July 2007, 23:38
  5. Associating icon with a file type
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 6th June 2006, 16:57

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
  •  
Qt is a trademark of The Qt Company.