From 7a14177a4398a163e5bb24cc192d6ddf7def3554 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Thu, 22 Feb 2024 11:18:55 -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)