BIM: Implement double-click event for materials group (#24767)

* BIM: Implement double-click event for materials group

Add double-click handling for materials group in Tree View.

Fixes: https://github.com/FreeCAD/FreeCAD/issues/24766

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Furgo
2025-10-21 14:07:13 +02:00
committed by GitHub
parent 80f5df8435
commit db31048f0d

View File

@@ -101,6 +101,16 @@ class _ViewProviderArchMaterialContainer:
actionReorder.triggered.connect(self.reorder)
menu.addAction(actionReorder)
def doubleClicked(self, vobj):
"""Handle double-click on the materials group in the Tree View.
Open the BIM Materials dialog and return True to indicate the event was handled
(prevents the tree from starting inline label editing, Qt's default behavior if the event
is not handled).
"""
FreeCADGui.runCommand("BIM_Material")
return True
def mergeByName(self):
if hasattr(self, "Object"):
mats = [o for o in self.Object.Group if o.isDerivedFrom("App::MaterialObject")]