From def2a99ed8bcbaafa12b406462370950b8928a97 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Thu, 27 Apr 2023 12:13:20 +0200 Subject: [PATCH] datawidget.py: raise AttributeError manually if item is graph, was not always raised; maybe problem of #52 --- src/gui_qt/data/datawidget/datawidget.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui_qt/data/datawidget/datawidget.py b/src/gui_qt/data/datawidget/datawidget.py index 515506e..1051bb8 100644 --- a/src/gui_qt/data/datawidget/datawidget.py +++ b/src/gui_qt/data/datawidget/datawidget.py @@ -350,6 +350,9 @@ class DataTree(QtWidgets.QTreeWidget): _id = item.data(0, QtCore.Qt.UserRole) if _id in ids: try: + if item.parent() is None: + raise AttributeError + idx = item.parent().indexOfChild(item) item.parent().takeChild(idx) if _id in self._checked_sets: