From 36d14d76fd471a4f14e4ba3dc2417ab18f43fe0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Mon, 1 Jan 2024 17:47:37 +0100 Subject: [PATCH] Doc: Mention AA_DontUseNativeDialogs in QFileDialog Pick-to: 6.6 6.5 Task-number: QTBUG-119551 Change-Id: I54f7e8f4b855b15d22b2180095cbf454b31412c3 Reviewed-by: Paul Wicking (cherry picked from commit d3117e97014af029b2c117daef9695b87103ab25) Reviewed-by: Volker Hilsheimer --- src/widgets/dialogs/qfiledialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index a83251929ec..13e1df8a960 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -138,8 +138,9 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir) dialog are not instantiated, so related accessors such as layout() and itemDelegate() 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 is used instead of the native dialog. + the user. You can set the \l DontUseNativeDialog option or set the + \l{Qt::AA_DontUseNativeDialogs}{AA_DontUseNativeDialogs} application attribute + to ensure that the widget-based implementation is used instead of the native dialog. \sa QDir, QFileInfo, QFile, QColorDialog, QFontDialog, {Standard Dialogs Example} */ @@ -202,7 +203,8 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir) \value DontUseNativeDialog Don't use a platform-native file dialog, but the widget-based one provided by Qt.\br By default, a native file dialog is shown unless you use a subclass - of QFileDialog that contains the Q_OBJECT macro or the platform + of QFileDialog that contains the Q_OBJECT macro, the global + \l{Qt::}{AA_DontUseNativeDialogs} application attribute is set, or the platform does not have a native dialog of the type that you require.\br For the option to be effective, you must set it before changing other properties of the dialog, or showing the dialog. @@ -2538,7 +2540,8 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent, On Windows and \macos, this static function uses 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 + to pass the \l{QFileDialog::}{DontUseNativeDialog} option, or set the global + \\l{Qt::}{AA_DontUseNativeDialogs} application attribute to display files using a QFileDialog. Note that the \macos native file dialog does not show a title bar.