tags:

views:

188

answers:

2

hello everyone,i would like to know is there any way to select only some directories and some files at a time using qfiledialog class.here i set filesfilter..but i also need to set folder filter i mean i want only certain/some folders to be selected of name (i mean i need a filter for folders too.. coz i hav a common format for my application folders like example : name.abc,flight.abc etc all these are my folder names..i want to enable selection only for these type of folders which are named at last as .abc) i am using

QStringList files = QFileDialog::getOpenFileNames(this, tr("Files & Directories"), QDir::currentPath(),tr(".doc.txt") );

tr(".doc.txt") is my files filter,same way i need folders filter with name only .abc at the end

A: 

It looks like you need to use proxy model for the open file dialog. Take a look on the QFileDialog::setProxyModel() and documentation of the Qt Model/View programming (http://doc.trolltech.com/4.6/model-view-proxy-models.html).

VestniK