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>
This commit is contained in:
parent
f11c190c06
commit
3f25eda0ed
@ -2716,7 +2716,7 @@ void QFileDialogPrivate::createWidgets()
|
|||||||
return;
|
return;
|
||||||
Q_Q(QFileDialog);
|
Q_Q(QFileDialog);
|
||||||
model = new QFileSystemModel(q);
|
model = new QFileSystemModel(q);
|
||||||
options->setFilter(model->filter());
|
model->setFilter(options->filter());
|
||||||
model->setObjectName(QLatin1String("qt_filesystem_model"));
|
model->setObjectName(QLatin1String("qt_filesystem_model"));
|
||||||
if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
|
if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
|
||||||
model->setNameFilterDisables(helper->defaultNameFilterDisables());
|
model->setNameFilterDisables(helper->defaultNameFilterDisables());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user