PyQT5之QTreeView

import os
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *


if __name__ == '__main__':
    app = QApplication(sys.argv)
    model = QDirModel()
    tree = QTreeView()
    tree.setModel(model)

    tree.setWindowTitle("QTreeView")
    tree.resize(600, 400)
    tree.show()
    sys.exit(app.exec_())

posted @ 2024-06-15 05:35  星空28  阅读(10)  评论(0编辑  收藏  举报