DigviJay Patil
DigviJay Patil

Reputation: 1016

Customized QFileDialog

I want to implement customized file open dialog using Qt. I have following scenario I have file with this kind of extension

a.txt.1
a.txt.2
a.txt.3

b.txt.1
b.txt.2

c.txt.1
c.txt.4

In file Dialog i want to show only file with highest number extension e.g. a.txt.3 , b.txt.2 , c.txt.4 is there any way to add filter in QFileDialog. If you have any suggestion besides from filtering please let me know.

Upvotes: 2

Views: 1436

Answers (1)

Max Go
Max Go

Reputation: 2102

You should implement and set your own proxy model:

void QFileDialog::setProxyModel(QAbstractProxyModel * proxyModel)

Sets the model for the views to the given proxyModel. This is useful if you want to modify the underlying model; for example, to add columns, filter data or add drives.

Upvotes: 4

Related Questions