Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.1.1, 5.3.1
-
None
-
Windows 7
-
4347e811611ab15e544765a3a34761d2f5c68cb3 (qtbase/5.5, 30.3.2015, 5.5)
Description
On Windows systems, there should be a way to open a QFileDialog on virtual folders such as "Computer", "Network", etc. Having this feature is required to build applications which are reasonably integrated with the operating system.
Those entities are normally accessed using CLSID such as:
::{20D04FE0-3AEA-1069-A2D8-08002B30309D} Shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
However, specifying such a string does not work. Sample call specifying the CLSDI for "Computer":
QFileDialog::getExistingDirectory(this, title, "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
The QFileDialog does not start on “Computer”, it starts on the current directory and the following error message appears on the console:
shellItem: SHCreateItemFromParsingName(:)) failed ()
According to various posts on the net, it is possible that it worked on older versions of Qt. It does not work on 5.1.
UPDATE: Almost a year passed since the problem was reported and the bug is still in "not evaluated" state. The problem is still there in 5.3.1.
It is really a pain to have no way to open a file / directory selection on "My Computer" when we need to ask the user to select a drive. Native Windows applications can do that easily using the CLSID.
Sample code:
#include <QApplication> #include <QFileDialog> #include <QDebug> int main(int argc, char *argv[]) { QApplication app(argc, argv); QString dir = QFileDialog::getExistingDirectory(0, "Test", "Shell:::{20d04fe0-3aea-1069-a2d8-08002b30309d}"); qDebug() << "Qt" << qVersion() << "Selection:" << dir; return 0; }
Attachments
Issue Links
- resulted in
-
QTBUG-51373 Windows/Native File Dialog: Default file name empty when passing file name that resembles a UUID
-
- Closed
-
For Gerrit Dashboard: QTBUG-33962 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
109342,9 | Windows: Support virtual folders as initial directory for file dialog. | 5.5 | qt/qtbase | Status: MERGED | -2 | 0 |
109564,2 | QFileDialog: Exclude "clsid:" URLs in QFileDialogPrivate::initialSelection(). | 5.5 | qt/qtbase | Status: ABANDONED | +1 | 0 |
153773,3 | Windows QPA: Fix regular expression to match CLSIDs in file dialog. | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |
154468,1 | Windows QPA: Fix regular expression to match CLSIDs in file dialog. | 5.7 | qt/qtbase | Status: ABANDONED | 0 | 0 |