Using the QFileFialog::setFileMode method twice on the same object don't correctly update the fileMode property.
In the attached test program has two buttons for choosing files and directories respectively.
The QFileFialog::setFileMode method is called any time the user press on a button but only works correctly the fist time.
If the user first clicks on the button for choosing a directory and then clicks the button for choosing a file the dialog remains in QFileDialog::Directory mode and don't allow files selection as expected.
Possible related bugs: QTBUG-3483