From 35e89176be643c2e2f090dddd0b9375656dc9a2d 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 c40089a..0e7eef2 100644 --- a/src/gui_qt/data/datawidget/datawidget.py +++ b/src/gui_qt/data/datawidget/datawidget.py @@ -342,6 +342,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: