PDA

View Full Version : How to filter executables in linux.



sudhansu
20th January 2010, 08:13
Hi All,
How it is possible to filter the Executable files in linux to show in QFileDialog?

Thank u all.

Lykurg
20th January 2010, 08:17
Hi,

see QFileDialog::setFilter() with QDir::Executable.

sudhansu
20th January 2010, 09:25
Hi,

see QFileDialog::setFilter() with QDir::Executable.

I did like


QFileDialog fileDlg;
fileDlg.setFilter(QDir::Executable);
QString fileName = open.getOpenFileName(this, tr("Open Executables "), QDir::homePath());

But its not working. I'm using Ubuntu.

Lykurg
20th January 2010, 17:35
First your pasted code is senseless since fileDlg and open are not the same. Second QFileDialog::getOpenFileName() is a static member function, so all settings you made before are not used. So use QFileDialog::exec() instead.