@@ -37,11 +37,20 @@ def __getattr__(name):
3737elif PYQT6 :
3838 from PyQt6 import QtWidgets
3939 from PyQt6 .QtGui import (
40+ QAction ,
4041 QActionGroup ,
4142 QFileSystemModel ,
4243 QShortcut ,
4344 QUndoCommand ,
4445 )
46+
47+ if parse (_qt_version ) < parse ("6.4" ):
48+ # Make `QAction.setShortcut` and `QAction.setShortcuts` compatible with Qt>=6.4
49+ # See spyder-ide/qtpy#461
50+ from qtpy .QtGui import QAction
51+ else :
52+ from PyQt6 .QtGui import QAction
53+
4554 from PyQt6 .QtWidgets import *
4655
4756 # Attempt to import QOpenGLWidget, but if that fails,
@@ -110,9 +119,15 @@ def __getattr__(name):
110119 from PySide2 .QtWidgets import *
111120elif PYSIDE6 :
112121 from PySide6 .QtGui import QActionGroup , QShortcut , QUndoCommand
113- from PySide6 .QtWidgets import *
114122
115- from qtpy .QtGui import QAction # See spyder-ide/qtpy#461
123+ if parse (_qt_version ) < parse ("6.4" ):
124+ # Make `QAction.setShortcut` and `QAction.setShortcuts` compatible with Qt>=6.4
125+ # See spyder-ide/qtpy#461
126+ from qtpy .QtGui import QAction
127+ else :
128+ from PySide6 .QtGui import QAction
129+
130+ from PySide6 .QtWidgets import *
116131
117132 # Attempt to import QOpenGLWidget, but if that fails,
118133 # don't raise an exception until the name is explicitly accessed.
0 commit comments