PDA

View Full Version : How to filter executables in linux.



sudhansu
20th January 2010, 07: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, 07:17
Hi,

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

sudhansu
20th January 2010, 08: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, 16: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.