Details
-
Bug
-
Resolution: Incomplete
-
P1: Critical
-
None
-
6.2.3, 6.3.0 Beta1
-
None
-
macOS 12.1 / 12.2 (M1)
Description
This is a regression experienced when upgrading Qt from 5.15 to 6.2.2.
In my application, I have two FileDialogs. One for picking file type A (e.g. documents), one for picking file type B (e.g. pictures).
The code looks as follows:
import QtQuick import QtQuick.Controls.Basic import QtQuick.Dialogs import QtCore Window { width: 640 height: 480 visible: true title: qsTr("Hello World") FileDialog { id: documentsDialog currentFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation) } Button { id: documentsButton text: qsTr("Open documents") onClicked: documentsDialog.open() } FileDialog { id: picturesDialog currentFolder: StandardPaths.writableLocation(StandardPaths.PicturesLocation) } Button { id: picturesButton text: qsTr("Open pictures") onClicked: picturesDialog.open() anchors.top: documentsButton.bottom anchors.topMargin: 16 } }
When I click the buttons to open the respective dialogs, Qt doesn't always open the FileDialogs at the correct paths specified via the currentFolder properties.
Reproduction:
- Click "Open documents" → Dialog opens in Documents folder
- Click "Open pictures" → Dialog opens in Pictures folder
- Click "Open documents" → Dialog opens in Documents or Pictures folder, depending on your luck
- Click "Open pictures" → Dialog opens in Documents folder (no luck involved)
- Click "Open documents" → Dialog opens in Pictures folder
- Click "Open documents" → Dialog opens in Documents folder
- Click "Open pictures" → Dialog opens in Documents folder
- Click "Open pictures" → Dialog opens in Pictures folder
As you can see, at some point the file picker always lags one step behind.
I haven't tested this on any other platform than macOS.
This didn't happen when using the Qt 5.15 FileDialog.
Workaround
Wrap each FileDialog in a Loader, load them when necessary and unload them afterwards.