Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.5.1, 5.6.2, 5.7.0, 5.9.7, 5.12.3
-
None
-
OS X 10.11, macOS 10.12, macOS 10.13
Description
FileDialog does not save the last used folder location when modality is set to Qt.WindowModal but saves when set to Qt.NonModal
I've attached sample project:
Steps to reproduce:
1. Build the project (I've used it with Kits 5.7.0, 5.6.2 and 5.5.1)
2. Run the project
3. Click Open File Dialog
4. File dialog should appear with default folder (on 5.5.1 it's always executable working dir, on 5.6.2 and 5.7.0 it's default or last saved location, meaning location saved when using dialog with Qt.NonModal modality setting)
5. Navigate to different folder with files, choose random file and click Open
6. Click Open File Dialog again
7. Last known used folder location appears for a brief moment and then it's replaced by default folder from step 4
Expected results:
The last used (saved) folder should be displayed in file dialog after its reopening.
Actual results:
The default folder is displayed in file dialog after its reopening when using default modality setting – Qt.WindowModal. It works as expected when using Qt.NonModal setting. File dialog is not displayed at all when using Qt.ApplicationModal settings QTBUG-42516
Update for Qt 5.9.7 and 5.12.3
There is now no apparent change of behaviour between Qt.WindowModal / Qt.NonModal modality modes, but the default location is always reset on app restart
Steps to reproduce
- Build the project
- Run the app
- Click Open File Dialog
- File dialog should appear with default folder which is strangely an executable working dir
- Navigate to different folder with files, choose random file and click Open
- Quit app
- Run the app
- Click Open File Dialog
Expected results:
The last used folder location will be opened with file dialog
Actual results:
The last used folder location is briefly replaced by the location of the application binary in the file dialog