From 3a68de1c9cc20dd2a8a20a5bac2a0a85bb4e1efc Mon Sep 17 00:00:00 2001 From: bdieterm <119257544+bdieterm@users.noreply.github.com> Date: Sun, 30 Mar 2025 16:10:35 +0200 Subject: [PATCH] CAM: fix context menu callbacks for Qt6 --- src/Mod/CAM/Path/Base/Gui/IconViewProvider.py | 5 ++++- src/Mod/CAM/Path/Main/Gui/Job.py | 5 ++++- src/Mod/CAM/Path/Op/Gui/Base.py | 5 ++++- src/Mod/CAM/Path/Tool/Gui/Controller.py | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Mod/CAM/Path/Base/Gui/IconViewProvider.py b/src/Mod/CAM/Path/Base/Gui/IconViewProvider.py index 6154b3307f..83ab71aabd 100644 --- a/src/Mod/CAM/Path/Base/Gui/IconViewProvider.py +++ b/src/Mod/CAM/Path/Base/Gui/IconViewProvider.py @@ -95,9 +95,12 @@ class ViewProvider(object): edit = translate("Path", "Edit") action = QtGui.QAction(edit, menu) - action.triggered.connect(self.setEdit) + action.triggered.connect(self._editInContextMenuTriggered) menu.addAction(action) + def _editInContextMenuTriggered(self, checked): + self.setEdit() + _factory = {} diff --git a/src/Mod/CAM/Path/Main/Gui/Job.py b/src/Mod/CAM/Path/Main/Gui/Job.py index e5f9e2f060..c2277e83e9 100644 --- a/src/Mod/CAM/Path/Main/Gui/Job.py +++ b/src/Mod/CAM/Path/Main/Gui/Job.py @@ -345,9 +345,12 @@ class ViewProvider: for action in menu.actions(): menu.removeAction(action) action = QtGui.QAction(translate("CAM_Job", "Edit"), menu) - action.triggered.connect(self.setEdit) + action.triggered.connect(self._editInContextMenuTriggered) menu.addAction(action) + def _editInContextMenuTriggered(self, checked): + self.setEdit() + class MaterialDialog(QtWidgets.QDialog): def __init__(self, parent=None): diff --git a/src/Mod/CAM/Path/Op/Gui/Base.py b/src/Mod/CAM/Path/Op/Gui/Base.py index 8203eaefc1..bbd76cf8d9 100644 --- a/src/Mod/CAM/Path/Op/Gui/Base.py +++ b/src/Mod/CAM/Path/Op/Gui/Base.py @@ -187,9 +187,12 @@ class ViewProvider(object): for action in menu.actions(): menu.removeAction(action) action = QtGui.QAction(translate("PathOp", "Edit"), menu) - action.triggered.connect(self.setEdit) + action.triggered.connect(self._editInContextMenuTriggered) menu.addAction(action) + def _editInContextMenuTriggered(self, checked): + self.setEdit() + class TaskPanelPage(object): """Base class for all task panel pages.""" diff --git a/src/Mod/CAM/Path/Tool/Gui/Controller.py b/src/Mod/CAM/Path/Tool/Gui/Controller.py index 29a107943a..7035ba5bb5 100644 --- a/src/Mod/CAM/Path/Tool/Gui/Controller.py +++ b/src/Mod/CAM/Path/Tool/Gui/Controller.py @@ -114,9 +114,12 @@ class ViewProvider: for action in menu.actions(): menu.removeAction(action) action = QtGui.QAction(translate("CAM", "Edit"), menu) - action.triggered.connect(self.setEdit) + action.triggered.connect(self._editInContextMenuTriggered) menu.addAction(action) + def _editInContextMenuTriggered(self, checked): + self.setEdit() + def claimChildren(self): obj = self.vobj.Object if obj and obj.Proxy and obj.Tool: