例如
self.tree_model = QStandardItemModel()
self.tree_model.setHorizontalHeaderLabels(['Category'])
self.out_insertions = QStandardItem("Insertions")
self.tree_model.invisibleRootItem().appendRow(self.out_insertions)
按预期工作(在“类别”列下插入“插入”行)。但如果我删除self.out_插入赋值,例如:
self.tree_model = QStandardItemModel()
self.tree_model.setHorizontalHeaderLabels(['Category'])
self.tree_model.invisibleRootItem().appendRow(QStandardItem("Insertions"))
我用的是Qt 4.6.3和PySide 0.4.1。
有人能解释一下为什么会这样吗?
提前谢谢