PDA

View Full Version : Default QFileDialog to "This PC" or "My Computer"



JayKemper
18th June 2015, 20:55
I'm running this command in Qt:



QStringList files = QFileDialog::getOpenFileNames(this,"Select Files",".");


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".

ChrisW67
18th June 2015, 22:12
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.