PDA

View Full Version : How to set the fileMode in QFileDialog?



qintm
27th March 2006, 13:24
I wish to only display the executable file in QFileDialog.Which parameter should be set in setFileMode().

zlatko
27th March 2006, 13:53
for Win use void QFileDialog::setFilters ( const QStringList & filters )

qintm
27th March 2006, 13:56
--------------------------------------------------------------------------------

I wish to only display the executable file(for linux)

jpn
27th March 2006, 14:22
I'm afraid this is not possible with the existent QFileDialog.

What you could do, though, is to construct a custom dialog showing a QDirModel in a QTreeView. Then you just apply QDir::Executable filter (http://doc.trolltech.com/4.1/qdirmodel.html#setFilter) for the dir model.