Setting initial directory as the mount point overview for fileSelector()

Discussion about recent product features & solutions!
2 posts • Page 1 of 1
ottemot
Posts:13
Joined: Wed Dec 02, 2015 2:30 pm

Setting initial directory as the mount point overview for fileSelector()

Post by ottemot »

Is there a way to set the initial directory for fileSelector() to be "This PC/"My Computer" on Windows (and the equivalent on other platforms)?

I know the fileSelector() is based on the QFileDialog which lets you do it.

The documentation of fileSelector() doesn't mention anything about this, but it would be useful when a file might be on different mount points.

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Setting initial directory as the mount point overview for fileSelector()

Post by mkoller »

The docs say that the second argument is "Target directory for selection.", so you need to pass a specific directory.
On Linux I'd say "your PC" is the whole filesystem, which starts at "/", so call fileSelector(s, "/");
The windows virtual pseudo locations can not be defined as start dir.

2 posts • Page 1 of 1