From 332d41d025b5e289821cf2bd81745471c76dce36 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 29 Jul 2015 13:55:05 +0200 Subject: [PATCH] Doc: QFileDialog::ShowDirsOnly not supported on Windows The native Windows file dialog does not support displaying files in the directory chooser. Task-number: QTBUG-46982 Change-Id: Ib58f3d888df564d42044b81ad8e67b8aeae5f3c6 Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qfiledialog.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index d2666026bb..64e3f5069e 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -189,7 +189,9 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir) \value AnyFile The name of a file, whether it exists or not. \value ExistingFile The name of a single existing file. \value Directory The name of a directory. Both files and - directories are displayed. + directories are displayed. However, the native Windows + file dialog does not support displaying files in the + directory chooser. \value ExistingFiles The names of zero or more existing files. This value is obsolete since Qt 4.5: @@ -2388,9 +2390,12 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent, pass. To ensure a native file dialog, \l{QFileDialog::}{ShowDirsOnly} must be set. - On Windows, and OS X, this static function will use the - native file dialog and not a QFileDialog. On Windows CE, if the device has - no native file dialog, a QFileDialog will be used. + On Windows and OS X, this static function will use the + native file dialog and not a QFileDialog. However, the native Windows file + dialog does not support displaying files in the directory chooser. You need + to pass \l{QFileDialog::}{DontUseNativeDialog} to display files using a + QFileDialog. On Windows CE, if the device has no native file dialog, a + QFileDialog will be used. On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, @@ -2398,7 +2403,7 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent, \a options includes DontResolveSymlinks, the file dialog will treat symlinks as regular directories. - On Windows the dialog will spin a blocking modal event loop that will not + On Windows, the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if \a parent is not 0 then it will position the dialog just below the parent's title bar.