Skip to content

Commit 429fd3d

Browse files
committed
Import only QAction separately as suggested by @ccordoba12
1 parent 855e832 commit 429fd3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

qtpy/QtWidgets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def __getattr__(name):
3737
elif PYQT6:
3838
from PyQt6 import QtWidgets
3939
from PyQt6.QtWidgets import *
40-
41-
from qtpy.QtGui import (
42-
QAction,
40+
from PyQt6.QtGui import (
4341
QActionGroup,
4442
QFileSystemModel,
4543
QShortcut,
4644
QUndoCommand,
4745
)
4846

47+
from qtpy.QtGui import QAction # See spyder-ide/qtpy#461
48+
4949
# Attempt to import QOpenGLWidget, but if that fails,
5050
# don't raise an exception until the name is explicitly accessed.
5151
# See https://github.com/spyder-ide/qtpy/pull/387/
@@ -112,8 +112,9 @@ def __getattr__(name):
112112
from PySide2.QtWidgets import *
113113
elif PYSIDE6:
114114
from PySide6.QtWidgets import *
115+
from PySide6.QtGui import QActionGroup, QShortcut, QUndoCommand
115116

116-
from qtpy.QtGui import QAction, QActionGroup, QShortcut, QUndoCommand
117+
from qtpy.QtGui import QAction # See spyder-ide/qtpy#461
117118

118119
# Attempt to import QOpenGLWidget, but if that fails,
119120
# don't raise an exception until the name is explicitly accessed.

0 commit comments

Comments
 (0)