QFileDialog's name filter not working as expected
-
I am trying to set the filter used in a file dialog. The filter seems to work fine except for the extension '.nii.gz'. On Mac OS X (Mavericks), all files with extension '.nii.gz' are grayed out. Any idea what's wrong? Thanks!
@ QFileDialog fileDialog;
QString fileName =
fileDialog.getOpenFileName(NULL,
tr("Open File"), "",
tr("Images (*.nii.gz *.nii *.mha *.mhd *.nrrd *.nhdr)"));
@ -
You do not need an object to use getOpenFileName(), it is a static function!
Perhaps you have hit some limitation of the QFileDialog. I have searched the documentation, but it is silent on this case. You may need to file a bug report.
-
Hi and welcome to devnet,
It seems to be a limitation of OS X's native file dialog though sierdzio has a point about your usage of the function.
The bug report about it can be found "here":https://bugreports.qt-project.org/browse/QTBUG-38303