[qt6] Add compatibility imports for QActionGroup

This moved from widgets -> gui in qt6
This commit is contained in:
Nyall Dawson 2024-05-17 12:26:56 +10:00 committed by Julien Cabieces
parent 6ebaee1025
commit 90fbb5383b
2 changed files with 4 additions and 2 deletions

View File

@ -44,8 +44,9 @@ def __qcolor_repr__(self: QColor):
QColor.__repr__ = __qcolor_repr__
if (QT_VERSION < 0x060000):
from PyQt5.QtWidgets import QAction as _QAction, QShortcut as _QShortcut
from PyQt5.QtWidgets import QAction as _QAction, QActionGroup as _QActionGroup, QShortcut as _QShortcut
QAction = _QAction
QActionGroup = _QActionGroup
QShortcut = _QShortcut

View File

@ -26,8 +26,9 @@ from PyQt@QT_VERSION_MAJOR@.QtWidgets import *
QLayout.setMargin = lambda self, m: self.setContentsMargins(m, m, m, m)
if @QT_VERSION_MAJOR@ == 6:
from PyQt6.QtGui import QAction as _QAction, QShortcut as _QShortcut
from PyQt6.QtGui import QAction as _QAction, QActionGroup as _QActionGroup, QShortcut as _QShortcut
QAction = _QAction
QActionGroup = _QActionGroup
QShortcut = _QShortcut
# patch back in Qt flags removed in PyQt