Automatically create QStackedWidget pages based on Tuple
问题 I'm fairly new to python, and I feel this is an advanced question, with that in mind it might be out of the scope of Stack Exchange. Please bear with me. I have a QTreeWidget and QStackedWidget. I have populated the QTreeWidget using a tuple TreeList = ({ 'Header1': (( 'Item11', 'Item12', )), 'Header2': (( 'Item21', 'Item22' )) }) for key, value in TreeList.items(): root = QTreeWidgetItem(self.QTreeWidget, [key]) for val in value: root.addChild(QTreeWidgetItem([val])) I would like to use this