I am using PySide6 to build a UI with a QTreeView that allows users to select a single item from a hierarchy. I have implemented the QStandardItemModel with user-checkable items, and I am updating the check state of the items in response to user input. However, after the first time an item is checked, the program crashes with the error "RuntimeError: Internal C++ object (PySide6.QtGui.QStandardItem) already deleted." I have reduced the code to a minimal example, which follows: from PySide6.QtWidgets import QDialog, QPushButton, QWidget, QLineEdit from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout, QSizePolicy, QTreeView from PySide6.QtGui import QIcon, QStandardItemModel, QStandardItem from PySide6.QtCore import Qt class MinimalModel(QStandardItemModel): def __init__(self, parent=None): super(MinimalModel, self).__init__(parent) self.root_item = self.invisibleRootItem() for i in range(2): item = QStandardItem("parent ...