PyQT5之QTreeView

星空28發表於2024-06-15
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_())

相關文章