From ae0cacb3838268a158e065879fb992b346429440 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Nov 2018 10:02:13 +0100 Subject: QFileDialog: Document that options need to be applied first Flesh out the existing note on QFileDialog::setOptions(), add it to QFileDialog::setOption() and add a small note to the DontUseNativeDialogs option value. Fixes: QTBUG-68590 Change-Id: I3a2011c8210d499114b01dfe09ad2dc797dfc2ab Reviewed-by: Leena Miettinen Reviewed-by: Richard Moe Gustavsen --- src/widgets/dialogs/qfiledialog.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/widgets/dialogs') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 5c6c03d3aa..9e270531f1 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -221,6 +221,9 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir) of QFileDialog that contains the Q_OBJECT macro, or the platform does not have a native dialog of the type that you require. + \note This option must be set before changing dialog properties + or showing the dialog. + \value ReadOnly Indicates that the model is readonly. \value HideNameFilterDetails Indicates if the file name filter details are @@ -722,6 +725,16 @@ bool QFileDialogPrivate::usingWidgets() const Sets the given \a option to be enabled if \a on is true; otherwise, clears the given \a option. + Options (particularly the DontUseNativeDialogs option) should be set + before changing dialog properties or showing the dialog. + + Setting options while the dialog is visible is not guaranteed to have + an immediate effect on the dialog (depending on the option and on the + platform). + + Setting options after changing other properties may cause these + values to have no effect. + \sa options, testOption() */ void QFileDialog::setOption(Option option, bool on) @@ -752,9 +765,15 @@ bool QFileDialog::testOption(Option option) const By default, all options are disabled. - Options should be set before showing the dialog. Setting them while the - dialog is visible is not guaranteed to have an immediate effect on the - dialog (depending on the option and on the platform). + Options (particularly the DontUseNativeDialogs option) should be set + before changing dialog properties or showing the dialog. + + Setting options while the dialog is visible is not guaranteed to have + an immediate effect on the dialog (depending on the option and on the + platform). + + Setting options after changing other properties may cause these + values to have no effect. \sa setOption(), testOption() */ -- cgit v1.2.3