From db31048f0d367eb80870ddcc4e93b98347f20bf3 Mon Sep 17 00:00:00 2001 From: Furgo <148809153+furgo16@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:07:13 +0200 Subject: [PATCH] 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> --- src/Mod/BIM/ArchMaterial.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Mod/BIM/ArchMaterial.py b/src/Mod/BIM/ArchMaterial.py index e094d10622..3cc837abaf 100644 --- a/src/Mod/BIM/ArchMaterial.py +++ b/src/Mod/BIM/ArchMaterial.py @@ -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")]