QtreeWidget中的数据类到层次结构表示

时间:2019-11-18 22:03:44

标签: python-3.x pyqt pyqt5

给出数据结构:

@dataclass
class NC:
    PN : string # group all NC instance with this attribute
    C1 : string
    C2 : string
    C3 : string

L1 = NC('80767','a','b','c')
L2 = NC('80767','aa','bb','cc')
L3 = NC('80198', 'az', 'bz','cz')

预期产量

80767
   -a|b|c
   -aa|bb|cc
80196
   -az[bz|cz

如何简单地在QtreeWideget中渲染它?

tree =  QTreeView()
tree.setModel(model)

0 个答案:

没有答案