使用QFileSystemModel仅显示一个目录 [英] Using QFileSystemModel to display only one directory
本文介绍了使用QFileSystemModel仅显示一个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用QFileSystemModel
仅列出一个目录内容,而不列出计算机中的所有驱动器(在Windows中)?
Is it possible to use QFileSystemModel
to list only one directory contents instead of all drives in my computer (in Windows)?
推荐答案
这将是您视图的功能,而不是您的模型:
That would be a function of your view, not your model:
http://doc.trolltech.com/latest/qabstractitemview. html#setRootIndex
更新:
这篇关于使用QFileSystemModel仅显示一个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文