#!/usr/bin/python
#--coding:GBK--
from PyQt4 import QtGui
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
model = QtGui.QDirModel()
tree = QtGui.QTreeView()
tree.setModel(model)
tree.setAnimated(False) # 展开方式
tree.setIndentation(20) # 压痕
tree.setSortingEnabled(True) # 排序
tree.setWindowTitle("Dir View")
tree.resize(640, 480)
tree.show()
sys.exit(app.exec_())
本文介绍如何使用PyQt4库创建一个文件浏览树视图,包括设置模型、视图、动画、压痕和排序等功能。
9168

被折叠的 条评论
为什么被折叠?



