Document that native file dialogs might not show a title

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 <morten.sorvig@qt.io>
This commit is contained in:
Volker Hilsheimer 2022-03-21 10:45:23 +01:00
parent 3fbe201d21
commit 49a5512f0b

View File

@ -167,9 +167,10 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
By default, a platform-native file dialog will be used if the platform has 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 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 dialog will not be instantiated, so related accessors such as layout() and
itemDelegate() will return null. You can set the \l DontUseNativeDialog option to itemDelegate() will return null. Also, not all platforms show file dialogs
ensure that the widget-based implementation will be used instead of the with a title bar, so be aware that the caption text might not be visible to
native dialog. 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}, \sa QDir, QFileInfo, QFile, QColorDialog, QFontDialog, {Standard Dialogs Example},
{Qt Widgets - Application Example} {Qt Widgets - Application Example}
@ -2082,7 +2083,8 @@ QString QFileDialog::labelText(DialogLabel label) const
then a default caption will be used. then a default caption will be used.
On Windows, and \macos, this static function will use the 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 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 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. then a default caption will be used.
On Windows, and \macos, this static function will use the 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 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 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 to pass \l{QFileDialog::}{DontUseNativeDialog} to display files using a
QFileDialog. 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 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}, 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 the file dialog will change to \c{/var/tmp} after entering \c{/usr/tmp}. If