________________________________________ From: interest-bounces+mitch.curtis=theqtcompany....@qt-project.org <interest-bounces+mitch.curtis=theqtcompany....@qt-project.org> on behalf of Julius Bullinger <julius.bullin...@asctec.de> Sent: Thursday, 13 August 2015 14:14 To: interest@qt-project.org Subject: [Interest] How to filter QFileSystemModel for use in QML
Dear list, I'm having problems using QFileSystemModel in QML. Take the following example code: // QQmlEngine* engine QFileSystemModel* fsm = new QFileSystemModel(engine); QModelIndex root = fsm->setRootPath("C:/Qt"); engine->rootContext()->setContextProperty("fileSystemModel", fsm); Now, using for example a QTreeView, one could set the root by using ``QTreeWidget::setRootIndex(root)`` to filter everything above the root level. But suppose I'd like to use the model in QML, e.g. in a TreeView QML component which doesn't have a setRoot() property. [snip] I'm not sure about the rest of your question, but TreeView has a rootIndex property in 5.6: https://codereview.qt-project.org/#/c/121991/ _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest