qlands
10th September 2016, 14:58
I have a QFileDialog that I want only to select executable files. Here is the code:
QFileDialog selectFile(this,title);
selectFile.setFilter(QDir::Files | QDir::Executable);
selectFile.setDirectory(path);
selectFile.setFileMode(QFileDialog::ExistingFile);
if (selectFile.exec())
qDebug() << selectFile.selectedFiles();
However I can see all files if I run it in Linux. Any idea how to correct it?
QFileDialog selectFile(this,title);
selectFile.setFilter(QDir::Files | QDir::Executable);
selectFile.setDirectory(path);
selectFile.setFileMode(QFileDialog::ExistingFile);
if (selectFile.exec())
qDebug() << selectFile.selectedFiles();
However I can see all files if I run it in Linux. Any idea how to correct it?