From 52fc162c31ed70a04075b5c9447d6cc59a1862ac Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 19 Jul 2024 11:28:16 +0200 Subject: [PATCH] BIM: Better fix to IFC viewprovider - fixes #15477 --- src/Mod/BIM/nativeifc/ifc_viewproviders.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Mod/BIM/nativeifc/ifc_viewproviders.py b/src/Mod/BIM/nativeifc/ifc_viewproviders.py index 1939bef16d..8c7ddbad5d 100644 --- a/src/Mod/BIM/nativeifc/ifc_viewproviders.py +++ b/src/Mod/BIM/nativeifc/ifc_viewproviders.py @@ -316,19 +316,17 @@ class ifc_vp_object: """Add an object to the view provider by d&d""" from PySide import QtCore # lazy import - self.incoming_object = incoming_object # delay the action to prevent the object to be deleted # before the end of the drop - QtCore.QTimer.singleShot(100, self.onDrop) + QtCore.QTimer.singleShot(100, lambda: self.onDrop(incoming_object)) - def onDrop(self): + def onDrop(self, incoming_object): """Delayed action to be taken when dropping an object""" from nativeifc import ifc_tools # lazy import - ifc_tools.aggregate(self.incoming_object, self.Object) + ifc_tools.aggregate(incoming_object, self.Object) if self.hasChildren(self.Object): self.expandChildren(self.Object) - del self.incoming_object def activate(self): """Marks this container as active"""