PDA

View Full Version : QFileDialog use



Doug Broadwell
23rd July 2007, 01:17
Is there a way to make a QFileDialog limited to staying in a given directory branch, e.g. it will display files and directories under /some/branch but nowhere else? Also, I would like the /some/branch to not show (everything appears as if in root directory).

Thanks

darksaga
23rd July 2007, 02:56
should be possible using:



void QFileDialog::setProxyModel ( QAbstractProxyModel * proxyModel )


subclass the QDirModel implementing the above requirements, then use the proxymodel as the mediator between the dirmodel and the QFileDialog...

that's what i would try first,

but maybe there's also simpler solution ???

greets

Doug Broadwell
24th July 2007, 18:37
I'm unable to find documentation on setProxyModel.

??

Thanks

jpn
25th July 2007, 07:26
I'm unable to find documentation on setProxyModel.
Looks like QFileDialog::setProxyModel() was introduced in Qt 4.3

Vaaco
15th February 2008, 09:24
Hi,

I have the same problem right now.

Were you able to solve it?

If I subclass QDirModel, how can I change the RootDirectory?