Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.0
-
Windows 7 x64 msvc2012
Description
main.qml
import QtQuick 2.0 import QtQuick.Dialogs 1.0 FileDialog { id: dialog Component.onCompleted: open() }
When I try to open file in read-only mode it shows
readonly.txt
This file is set to read-only.
Try again with a different file name.
[OK]
and doesn't accept selection.
The problem is in /qtdeclarative/src/imports/dialogs/qquickabstractfiledialog.cpp
Ctor sets m_selectExisting to true but m_options->fileMode() is AnyFile by default. But according QQuickAbstractFileDialog::updateModes() it shoud be ExistingFiles.
Please add updateModes() call to ctor to fix this issue.
Workaround.qml
import QtQuick 2.0 import QtQuick.Dialogs 1.0 FileDialog { id: dialog Component.onCompleted: { // Blink property to cause updateModes() call selectExisting = false; selectExisting = true; open(); } }