Skip to content

Commit

Permalink
fix: [file-dialog] Can not change filter in filedialog.
Browse files Browse the repository at this point in the history
Not clear the records of last filter.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-299607.html
  • Loading branch information
GongHeng2017 committed Jan 10, 2025
1 parent 1f49797 commit 56da071
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@ FileDialogHandle::FileDialogHandle(QWidget *parent)
auto window = qobject_cast<FileDialog *>(FMWindowsIns.findWindowById(d_func()->dialog->internalWinId()));
if (window) {
QObject::connect(window, &FileDialog::initialized, this, [this]() {
if (!d_func()->lastFilterGroup.isEmpty())
if (!d_func()->lastFilterGroup.isEmpty()) {
d_func()->dialog->setNameFilters(d_func()->lastFilterGroup);
if (!d_func()->lastFilter.isEmpty())
d_func()->lastFilterGroup.clear();
}
if (!d_func()->lastFilter.isEmpty()) {
d_func()->dialog->selectNameFilter(d_func()->lastFilter);
d_func()->lastFilter.clear();
}
});
}
}
Expand Down

0 comments on commit 56da071

Please sign in to comment.