Results 1 to 2 of 2

Thread: Default QFileDialog to "This PC" or "My Computer"

  1. #1
    Join Date
    Jun 2015
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Default QFileDialog to "This PC" or "My Computer"

    I'm running this command in Qt:

    Qt Code:
    1. QStringList files = QFileDialog::getOpenFileNames(this,"Select Files",".");
    To copy to clipboard, switch view to plain text mode 

    What string do I use to get it to default to "This PC" or "My Computer" instead of "."?

    Edit:

    I found the GUID for "This PC" ("::{20d04fe0-3aea-1069-a2d8-08002b30309d}"), but it seems to go to the last place I open something instead of "This PC".
    Last edited by JayKemper; 18th June 2015 at 22:07.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Default QFileDialog to "This PC" or "My Computer"

    You can use QStandardPaths to look up a range of actual directory locations like Documents or Desktop. I do not know a way to have the non-location "My Computer" selected in the native dialog.

Similar Threads

  1. Replies: 3
    Last Post: 16th March 2015, 07:31
  2. Replies: 1
    Last Post: 3rd December 2013, 02:19
  3. Replies: 1
    Last Post: 7th April 2010, 21:46
  4. "new QFileDialog" vs. "getSaveFileName" drive names
    By Rayven in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2008, 13:11
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.