Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.10.1, 5.12.3
-
None
-
-
de704b633 (dev), c662fb0be (6.5), b75ab7662 (6.4)
Description
Sample code:
Button { id: filtersButton property bool flag: true anchors.centerIn: parent text: flag ? "PNG (*.png)" : "JPEG (*.jpg)" onClicked: flag = !flag } Button { id: openButton anchors.horizontalCenter: filtersButton.horizontalCenter anchors.top: filtersButton.bottom anchors.topMargin: 16 text: "Open" onClicked: fileDialog.visible = true } FileDialog { id: fileDialog nameFilters: filtersButton.text }
Steps to reproduce:
1. Click openButton to open file dialog.
QWindowsNativeFileDialogBase::setNameFilters will be called, which will set m_nameFilters.
2. Close file dialog.
3. Click filtersButton to swap filters.
QWindowsNativeFileDialogBase::selectNameFilter will be called. It will try to find index of a new filter in m_nameFilters. But it fails because m_nameFilters still contains old list of filters, since it is updated only on the dialog open. This produce two similar messages in console:
QWindowsNativeFileDialogBase::selectNameFilter: Invalid parameter 'JPEG (*.jpg)' not found in 'PNG (*.png)'. QWindowsNativeFileDialogBase::selectNameFilter: Invalid parameter 'JPEG (*.jpg)' not found in 'PNG (*.png)'.
Attachments
Issue Links
- relates to
-
QTBUG-61042 A QML FileDialog shows a warning in a console after reseting the 'nameFilters' property
- Closed
For Gerrit Dashboard: QTBUG-77211 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
453915,9 | Windows: fix warning on opening FileDialog after changing filters | dev | qt/qtbase | Status: MERGED | +2 | 0 |
456545,2 | Windows: fix warning on opening FileDialog after changing filters | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
456546,2 | Windows: fix warning on opening FileDialog after changing filters | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |