I wonder how it is possible to set a custom acceptance condition for a QFileDialog.

what I want to do is to have a dialog that would only accept directories that have a file of a certain name in them (say, a file named foo.bar). so when the QFileDialog is displayed, the Open button would only be enabled if the directory being selected matches the property of having a file named 'foo.bar' in it.

I looked at the QFileDialog API, but did not find a way to add such a custom test.

any pointers would be appreciated.