From e28f54f598fe2d9fe4d36132b0618ae8dfb10a10 Mon Sep 17 00:00:00 2001 From: Furgo <148809153+furgo16@users.noreply.github.com> Date: Sat, 18 Oct 2025 15:34:10 +0200 Subject: [PATCH] BIM: Prevent editing label on double-click (#24712) Before this fix, double-clicking on an ArchMultimaterial object opened its task panel as expected. Unexpectedly, its label was selected and set for edit. - The tree view's double-click handling expects the view-provider to declare whether it handled the double-click. - The ViewProvider API's doubleClicked() is documented to return bool (True if handled). - If a view provider's doubleClicked method returns None/False, the tree falls back to the default Qt behavior (which is beginning inline editing of the item label). - In ArchMaterial.py the view provider calls self.edit() (or FreeCADGui.ActiveDocument.setEdit(...)) but the method that the tree actually calls (the view provider's doubleClicked) does not return True. Because the method returns None, the tree continues and starts inline label-editing. In summary: setEdit returning True is fine, but doubleClicked is the method the tree checks; it must return True to suppress the default inline rename. --- src/Mod/BIM/ArchMaterial.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mod/BIM/ArchMaterial.py b/src/Mod/BIM/ArchMaterial.py index 8a7b0e9cfc..025656d4d6 100644 --- a/src/Mod/BIM/ArchMaterial.py +++ b/src/Mod/BIM/ArchMaterial.py @@ -778,6 +778,7 @@ class _ViewProviderArchMultiMaterial: def doubleClicked(self, vobj): self.edit() + return True def setupContextMenu(self, vobj, menu): if FreeCADGui.activeWorkbench().name() != "BIMWorkbench":