pyside_dirmodel.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
import sys
# from PySide2.QtCore import ()
# from PySide2.QtGui import ()
from PySide2.QtWidgets import (QApplication, QMainWindow, QDialog, QTreeView, QDirModel)


class SampleUI(QMainWindow):

    def __init__(self, parent=None):
        super().__init__(parent)

        listView = QTreeView()
        self.setCentralWidget(listView)

        model = QDirModel()
        listView.setModel(model)


if __name__ == "__main__":
    app = QApplication(sys.argv)

    ui = SampleUI()
    ui.show()
    sys.exit(app.exec_())

最終更新日: 2022-06-15 15:27:01