mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-23 15:45:15 +00:00
Enable options that only require little to no code fixes. Signed-off-by: Chris PeBenito <pebenito@ieee.org>
28 lines
859 B
Python
28 lines
859 B
Python
# SPDX-License-Identifier: LGPL-2.1-only
|
|
|
|
import abc
|
|
|
|
from PyQt6 import QtCore, QtGui
|
|
|
|
# These are all of the return types for the standard QtCore.Qt.ItemDataRole roles
|
|
# for the data method in the models.
|
|
AllStdDataTypes = str | QtGui.QColor | QtGui.QIcon | QtGui.QPixmap | QtCore.QSize | \
|
|
QtGui.QFont | QtCore.Qt.AlignmentFlag | QtGui.QBrush | QtCore.Qt.CheckState | \
|
|
QtCore.Qt.SortOrder | None
|
|
|
|
# This is the return type for the ModelRoles.ContextMenuRole role
|
|
ContextMenuType = tuple[QtGui.QAction, ...]
|
|
|
|
|
|
class MetaclassFix(type(QtCore.QObject), abc.ABC): # type: ignore[misc]
|
|
|
|
"""
|
|
Fix metaclass issues.
|
|
|
|
Use this when doing a Generic[] with a PyQt type. Fixes this error:
|
|
|
|
TypeError: metaclass conflict: the metaclass of a derived class must be a
|
|
(non-strict) subclass of the metaclasses of all its bases
|
|
"""
|
|
pass
|