Results 1 to 4 of 4

Thread: To identify executable and other files in QT Application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: To identify executable and other files in QT Application

    Linux uses mime types instead of extensions, so you would get the mime type for your file and if it says "executable", then you would use QProcess to execute it/etc.

    If you are unsure of the mime type used for a particular file, you can use the 'mimetype' command to figure it out. It's like 'file' but uses mime types instead of descriptions.

  2. #2
    Join Date
    Jan 2010
    Posts
    73
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6
    Thanked 8 Times in 8 Posts

    Default Re: To identify executable and other files in QT Application

    I use fedora, and it supports the file command, but not mimetype. I do have a high level of curiosity, however, so I poked around a bit.

    I am stating what I believe to be true with hopes that you will correct me if I am incorrect.

    • Gnome uses mime types to associate applications with files.
    • Gnome mime types use magic numbers to recognize the mime type.
    • There may be multiple associations for a specific type; for example, an OOo document may associate to an OOo document type and also to a ZIP file. This is, of course, as it should be.


    I looked at the gnome mime-type stuff in the file /etc/gnome-vfs-mime-magic

    Very interesting...

Similar Threads

  1. How to Create Executable file for my QT application
    By c_srikanth1984 in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2009, 04:02
  2. How to identify Num pad keys
    By sanjayshelke in forum Qt Programming
    Replies: 1
    Last Post: 2nd September 2008, 17:43
  3. identify QGraphicItem
    By avis_phoenix in forum Qt Programming
    Replies: 5
    Last Post: 24th September 2007, 06:16
  4. How to identify the process
    By vishesh in forum Qt Programming
    Replies: 1
    Last Post: 28th April 2007, 16:18
  5. How to identify event sender?
    By Caius Aérobus in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2006, 10:14

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.