I am creating an instance of QFileDialog (Qt5.0.2.) which I want to use to allow the user to select a directory. After creation but before showing the dialog, I am executing the setFileMode(QFileDialog::Directory) method to specify the desired behaviour. Under Linux this does exactly what I think it should. So far, so good.
When I cross-build (the same project) for Windows under Linux (using the MXE cross tools), the QFileDialog reverts to its default behaviour of only allowing the user to select a file. If the user selects a directory, that directory is opened, not selected. This happens under both Wine and on running the cross-built executable on WinXP.
Further, if I build the project natively on WinXP, I still get the wrong behaviour in QFileDialog.
I have added an assert after executing setFileMode() to check the file mode using the fileMode() method and it appears correct. The title of the QFileDialog instance is “Find Directory” (which I am not setting separately).
Am I missing something obvious or is this a pretty egregious bug?
↧