Results 1 to 4 of 4

Thread: Multiplateform open folder in explorer

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Multiplateform open folder in explorer

    Hey guys,

    I need to open a folder window in the native OS's explorer.

    - Explorer on Windows.
    - Finder on MacOSX.
    - ...

    Anyone ever did that ?

    Thanks.

  2. #2
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multiplateform open folder in explorer

    Would something like this be sufficient?
    Qt Code:
    1. #include <QtGlobal>
    2.  
    3. #if defined Q_OS_WIN32
    4. // start explorer process here. E.g. "explorer.exe C:\windows"
    5. #elif defined Q_OS_DARWIN
    6. // start finder process here
    7. #elif defined Q_OS_WHATEVER
    8. // start WHATEVER filebrowser here
    9. #endif
    To copy to clipboard, switch view to plain text mode 
    So already the precompiler decides what process to start.

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

    bunjee (12th July 2009)

  4. #3
    Join Date
    Jan 2011
    Location
    Kyiv, Ukraine
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multiplateform open folder in explorer

    http://stackoverflow.com/questions/3...xplorer-on-nix

    found a better solution on stack overflow.
    Last edited by Okspen; 9th January 2011 at 17:33.

  5. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Multiplateform open folder in explorer

    Edit:
    sorry, I see now.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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.