Results 1 to 3 of 3

Thread: Customize FileDialog to allow access only to removable drives

  1. #1
    Join Date
    Apr 2009
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Customize FileDialog to allow access only to removable drives

    Hi,

    In my application, I'm trying to restrict user access to the local drives. Hence I am looking to customize the File Dialog to display only removable drives (e.g. USB devices). Any idea how to go about this? Appreciate any help. Thanks.

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Customize FileDialog to allow access only to removable drives

    No suggestions on how to do it. Just a warning not to. It's my computer, and if I want to store or read a file on or from any drive or other device I own, that's my decision. I really, really despise software that tries to make such decisions for me.

    At most, examine the drive requested and put up a warning dialog that using non-removable drives may not be wise, offering a reason. And be sure to put a checkbox on the dialog that allows the user to shut it up if they're not interested in heeding your advice.

  3. #3
    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: Customize FileDialog to allow access only to removable drives

    This is not portable, and has nothing to do with Qt.
    You have to look at the documentation for the OS you want to support with this feature- you will have to access the device properties and see if the device you are looking at is a removable or not.
    ==========================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.

Similar Threads

  1. problem copying files and unmount drives
    By alejo in forum Qt Programming
    Replies: 2
    Last Post: 14th July 2009, 20:54
  2. QDirIterator and windows drives
    By invictus in forum Qt Programming
    Replies: 0
    Last Post: 8th March 2009, 19:48
  3. Open FileDialog showing Back of the Widget in Mac
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2007, 06:33
  4. Replies: 12
    Last Post: 7th February 2007, 13:30
  5. Replies: 1
    Last Post: 20th July 2006, 09:54

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.