diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-11-09 10:02:13 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-14 20:15:04 +0000 |
commit | ae0cacb3838268a158e065879fb992b346429440 (patch) | |
tree | a39a3439f4b5f670f7c378cd9d9bcefc7b98c41f /src/widgets/dialogs | |
parent | 67c29f15bd825f6246c8e993083ba7b87ad3b33e (diff) |
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 <riitta-leena.miettinen@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
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() */ |