MCPcopy Create free account
hub / github.com/PyQt5/PyQt / __init__

Method __init__

Test/ChartView/ChatWidget.py:56–73  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

54 fileSelected = pyqtSignal(str)
55
56 def __init__(self, *args, **kwargs):
57 super(ClassifyWidget, self).__init__(*args, **kwargs)
58 self.setHeaderHidden(True)
59 self.setColumnCount(1)
60 self.itemDoubleClicked.connect(self.onItemDoubleClicked)
61 baseDir = "分类"
62 for name in os.listdir(baseDir):
63 path = os.path.join(baseDir, name)
64 if os.path.isdir(path):
65 item = QTreeWidgetItem(self)
66 item.setText(0, name)
67 for file in os.listdir(path):
68 path = os.path.join(path, file)
69 if os.path.isfile(path) and file.endswith(".json"):
70 item = QTreeWidgetItem(item)
71 item.setText(0, os.path.splitext(file)[0])
72 item.setToolTip(0, path)
73 self.expandAll()
74
75 def onItemDoubleClicked(self, item):
76 file = item.toolTip(0)

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected