问题描述
我正在将一个项目从 python27 迁移到 python37,以便我可以从使用 PyQt 切换到 PySide。重构我的代码时,我现在无法删除从 QTreeWidgetItem 继承的自定义类的实例
class CustomTreeItem(qtwidget.QTreeWidgetItem):
最初,我只是在做 sip.delete(CustomTreeItem object)
。但是,在迁移后,我尝试对 shiboken2.delete(CustomTreeItem object)
执行相同的操作并收到错误
进程完成,退出代码 -1073741819 (0xC0000005)
以为是shiboken2的错误,尝试了其他的删除方法
assm_tree_widget.clear()
和
selections = assm_tree_widget.selectedItems()
for item in selections:
index = assm_tree_widget.indexOfTopLevelItem(item)
assm_tree_widget.takeTopLevelItem(index)
这两者都会抛出类似的退出代码。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)