QFileDialog with no edit box

Hi,
The following code pops up a dialog window showing File name edit box where selected filename is set. But I don't want to show this edit box.
I want to show only just list of files in the directory.
QFileDialog dialog(this, "Source Directory", filename);
dialog.exec();

Try the QFileDialog::HideNameFilterDetails option. If it doesn't work, then I believe the only way to modify the file dialog in such a way is to switch to the alien implementation and hide the text box manually. E.g.:

@kshegunov
Sorry, but neither works,
The first one just use non-native Filadialog which also has editbox.
The second one crashes. It maybe there is no object named fileNameEdit on QFileDialog class. I tried to find an object name on QFileDialog.h but I could not see any.

@kshegunov
I installed Qt 5.5.0 by
qt-opensource-windows-x86-mingw492-5.5.0.exe
I could not see qfiledialog.ui because, I think, it is not source code.
If fileNameEdit is the correct name, I don't understand why it crashes.

If fileNameEdit is the correct name, I don't understand why it crashes.

By "crashes" you probably mean you trip the assertion I've put. Why I don't know for sure, you should debug it and check against your sources (if those are not available, building Qt so you obtain a source tree corresponding to the binary, might be a good idea).

Even if we accept, as the basic tenet of true democracy, that one moron is equal to one genius, is it necessary to go a further step and hold that two morons are better than one genius?

@SGaist
Thank you SGaist and kshegunov,
I was silly, I should have put QFileDialog::DontUseNativeDialog.
Now with the following, I could hide fileNameEdit, filenameLabel and
buttonBox. It looks much better now. By the way, do we need QStringLiteral?