[Interest] How to filter QFileSystemModel for use in QML

Julius Bullinger Julius.Bullinger at asctec.de
Fri Aug 14 08:49:28 CEST 2015


Nikita Krupenko [mailto:krnekit at gmail.com]  wrote on Thursday, 13. August 2015 15:01 Uhr:

> Have you tried DelegateModel? It is like a proxy and allows you to set root index:
> http://doc.qt.io/qt-5/qml-qtqml-models-delegatemodel.html#rootIndex-prop

This seems like a decent solution, although I'm not very keen on the idea that I need two C++ and one QML models to show a list of files in a directory. Thank you, though!

I'm wondering if there's an explanation for the ``setRootPath()`` method actually _not_ changing the model root. I feel like it would be way cleaner that way, but I suppose there's a good reason.

Regards,
Julius


More information about the Interest mailing list