From df1fcce156f7d67a221ccb274b90e7eb8ae21cf8 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Wed, 21 Feb 2024 14:45:44 -0700 Subject: [PATCH] Use string representation for QKeySequence construction This fixes an issue in PySide6 v6.6.2 where key sequence construction with the | operator is broken, and improves readability. --- qtconsole/frontend_widget.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qtconsole/frontend_widget.py b/qtconsole/frontend_widget.py index 9cc96a59..0a788bb9 100644 --- a/qtconsole/frontend_widget.py +++ b/qtconsole/frontend_widget.py @@ -189,9 +189,8 @@ def __init__(self, local_kernel=_local_kernel, *args, **kw): # Configure actions. action = self._copy_raw_action - key = QtCore.Qt.CTRL | QtCore.Qt.SHIFT | QtCore.Qt.Key_C action.setEnabled(False) - action.setShortcut(QtGui.QKeySequence(key)) + action.setShortcut(QtGui.QKeySequence("Ctrl+Shift+C")) action.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut) action.triggered.connect(self.copy_raw) self.copy_available.connect(action.setEnabled)