When I set up a QFileDialog – either with the easy static functions or with the constructors – to filter only a specific file extension. By default, the (non-native) QFileDialog greys out the not filtered entries.
Is there a way to make the dialog to hide these entries completely?
QStringList filters;
filters << "Module Dll's (*_qtmdl.dll)"
<< "Dll's (*.dll)"
<< "All Files (*)";
QFileDialog dialog(0,"Select a module DLL file.");
dialog.setFileMode(QFileDialog::AnyFile);
dialog.setViewMode(QFileDialog::Detail);
dialog.setOptions(QFileDialog::HideNameFilterDetails |
QFileDialog::DontUseNativeDialog );
dialog.setNameFilters(filters);
QStringList fileNames;
if(dialog.exec())
fileNames = dialog.selectedFiles();
If I understand it correctly, subclassing the proxy would allow me to influence the filter (like the solution here. [stackoverflow.com] – But is there a way that I can completely hide the filtered entries?
↧