2

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.

DigviJay Patil
  • 986
  • 14
  • 31

1 Answers1

4

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.

Max Go
  • 2,092
  • 1
  • 16
  • 26
  • 2
    as per your suggestion i have implemented and it works Thank you for your helped also this link help me http://stackoverflow.com/questions/4893122/filtering-in-qfiledialog/4893903#4893903 – DigviJay Patil Oct 02 '14 at 11:38