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.
This commit is contained in:
Furgo
2025-10-18 15:34:10 +02:00
committed by GitHub
parent bbea8ace72
commit e28f54f598

View File

@@ -778,6 +778,7 @@ class _ViewProviderArchMultiMaterial:
def doubleClicked(self, vobj):
self.edit()
return True
def setupContextMenu(self, vobj, menu):
if FreeCADGui.activeWorkbench().name() != "BIMWorkbench":