Multi-level QTreeView
I'm having a hard time understanding how to set a multilevel QTree using the QTreeView and QStandardItemModel. Here's what I have: from PySide.QtGui import * import sys class MainFrame(QWidget): def __init__(self): QWidget.__init__(self) tree = {'root': { "1": ["A", "B", "C"], "2": { "2-1": ["G", "H", "I"], "2-2": ["J", "K", "L"]}, "3": ["D", "E", "F"]} } self.tree = QTreeView(self) root_model = QStandardItemModel() self.tree.setModel(root_model) for r,root in enumerate(sorted(tree)): root_item = QStandardItem(root) root_model.setItem(r,root_item) for c,child in enumerate(sorted(tree[root])):