Results 1 to 4 of 4

Thread: Invoking "Choose Application" application launcher from native OS

  1. #1
    Join Date
    Apr 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Invoking "Choose Application" application launcher from native OS

    Is there a way to invoke the "Choose Application" dialog / application launcher from the native OS?

    e.g. in Windows the Open With dialog allows the user to pick which application to open a selected file with, and presents a list of apps which were previously associated with that file extension



    I realize QProcess is used for calling arbitrary applications but I'm looking for a more simplistic solution that leverages the native OS' built-in mechanism for handling the opening of various file extensions

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Invoking "Choose Application" application launcher from native OS

    I don't think Qt supports this feature yet.
    You can try using the native command line options i.e, run "RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL <myfile.ext>" using QProcess, it should open a open with dialog

    Edit: By the way did you try, bool QDesktopServices:: openUrl ( const QUrl & url );
    Last edited by Santosh Reddy; 13th August 2011 at 03:57. Reason: updated contents

  3. #3
    Join Date
    Aug 2010
    Posts
    99
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Invoking "Choose Application" application launcher from native OS

    Even if Qt can't do it, i think you can do it with the Windows API. I think you can call ShellExecuteEx with the "openas" verb, and that will show the dialog you want. Although, i think that only works with Windows 7 (or Vista). As far as i know, there is no way of programmatically showing that dialog in XP.
    [Window Detective] - Windows UI spy utility
    [War Thunder]

  4. #4
    Join Date
    Apr 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Invoking "Choose Application" application launcher from native OS

    Quote Originally Posted by Santosh Reddy View Post
    I don't think Qt supports this feature yet.
    You can try using the native command line options i.e, run "RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL <myfile.ext>" using QProcess, it should open a open with dialog

    Edit: By the way did you try, bool QDesktopServices:: openUrl ( const QUrl & url );
    I do have another context menu option named "Open" which uses the openUrl (this context menu item simply opens the file with the default associated app) but I was hoping for the "Choose Application" dialog for a separated related context menu item

Similar Threads

  1. Replies: 8
    Last Post: 5th November 2012, 08:43
  2. Replies: 2
    Last Post: 27th July 2011, 04:24
  3. Replies: 6
    Last Post: 16th June 2011, 13:20
  4. Replies: 3
    Last Post: 2nd November 2010, 22:36
  5. Replies: 3
    Last Post: 11th January 2009, 05:22

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.