From 49a5512f0b68cf0f3da3c5ba1b6f9cce4e358bb0 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 21 Mar 2022 10:45:23 +0100 Subject: Document that native file dialogs might not show a title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native dialogs on macOS haven't shown a title bar since macOS 10.11. The caption string passed in might not be visible to the end user, which can be problematic for certain applications that use the title text to provide context to the user. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-59805 Change-Id: I3a1cea8f11a62c0927a9ba00159a118e2b078956 Reviewed-by: Morten Johan Sørvig --- src/widgets/dialogs/qfiledialog.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/widgets/dialogs/qfiledialog.cpp') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 4e460026a4..f8378c0c08 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -167,9 +167,10 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir) By default, a platform-native file dialog will be used if the platform has one. In that case, the widgets which would otherwise be used to construct the dialog will not be instantiated, so related accessors such as layout() and - itemDelegate() will return null. You can set the \l DontUseNativeDialog option to - ensure that the widget-based implementation will be used instead of the - native dialog. + itemDelegate() will return null. Also, not all platforms show file dialogs + with a title bar, so be aware that the caption text might not be visible to + the user. You can set the \l DontUseNativeDialog option to ensure that the + widget-based implementation will be used instead of the native dialog. \sa QDir, QFileInfo, QFile, QColorDialog, QFontDialog, {Standard Dialogs Example}, {Qt Widgets - Application Example} @@ -2082,7 +2083,8 @@ QString QFileDialog::labelText(DialogLabel label) const then a default caption will be used. On Windows, and \macos, this static function will use the - native file dialog and not a QFileDialog. + native file dialog and not a QFileDialog. Note that the \macos native file + dialog does not show a title bar. On Windows the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if \a parent is not \nullptr then it will position @@ -2193,7 +2195,8 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent, then a default caption will be used. On Windows, and \macos, this static function will use the - native file dialog and not a QFileDialog. + native file dialog and not a QFileDialog. Note that the \macos native file + dialog does not show a title bar. On Windows the dialog will spin a blocking modal event loop that will not dispatch any QTimers, and if \a parent is not \nullptr then it will position @@ -2558,6 +2561,8 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent, to pass \l{QFileDialog::}{DontUseNativeDialog} to display files using a QFileDialog. + Note that the \macos native file dialog does not show a title bar. + 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}, the file dialog will change to \c{/var/tmp} after entering \c{/usr/tmp}. If -- cgit v1.2.3