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>
bb10
Friedemann Kleint 2018-11-09 10:02:13 +01:00 committed by Liang Qi
parent 67c29f15bd
commit ae0cacb383
1 changed files with 22 additions and 3 deletions

View File

@ -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()
*/