diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-02-12 17:07:46 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-02-13 12:33:49 +0000 |
commit | 3f25eda0ed669e61cc5e77f8d75771049ffab0c0 (patch) | |
tree | 8662ab38311c2041694e53a8db4c855a2d890b84 /src/widgets/dialogs/qfiledialog.cpp | |
parent | f11c190c06369892a41794c644ddbf15810608fc (diff) |
QFileDialog: fix overwritten filter
Consider the following code:
QFileDialog dlg;
dlg.setFilter(QDir::Hidden | ...);
dlg.setOption(QFileDialog::DontUseNativeDialog)
setFilter stores the filter value in QDialogPrivate::options.
setOption will overwrite this value with the default value from
a newly created QFileSystemModel.
The intention was to set the filter in the model to the value in
options.
Change-Id: I561c5cf1ad4d9d729a56620d86ec549eb3105a07
Task-number: QTBUG-37085
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/widgets/dialogs/qfiledialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 6065ad015e..9d5d8d2e24 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2716,7 +2716,7 @@ void QFileDialogPrivate::createWidgets() return; Q_Q(QFileDialog); model = new QFileSystemModel(q); - options->setFilter(model->filter()); + model->setFilter(options->filter()); model->setObjectName(QLatin1String("qt_filesystem_model")); if (QPlatformFileDialogHelper *helper = platformFileDialogHelper()) model->setNameFilterDisables(helper->defaultNameFilterDisables()); |