Add compat for enums from QSizePolicy and QLayout

This commit is contained in:
Kovid Goyal 2022-01-05 09:44:56 +05:30
parent a67fcb81f1
commit da775a7adc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -8,9 +8,9 @@
from qt.core import (
QAbstractItemView, QAction, QComboBox, QDialog, QDialogButtonBox, QDrag,
QEventLoop, QFontMetrics, QFormLayout, QFrame, QImage, QIODevice, QLineEdit,
QMenu, QMessageBox, QModelIndex, QPalette, QSinglePointEvent, Qt, QThread,
QToolButton, QEvent, QDropEvent, QHoverEvent
QDropEvent, QEvent, QEventLoop, QFontMetrics, QFormLayout, QFrame, QHoverEvent,
QImage, QIODevice, QLayout, QLineEdit, QMenu, QMessageBox, QModelIndex, QPalette,
QSinglePointEvent, QSizePolicy, Qt, QThread, QToolButton
)
from calibre_extensions import progress_indicator
@ -64,7 +64,8 @@ QFontMetrics.width = lambda self, text: self.horizontalAdvance(text)
# Restore enum values to various classes
for cls in (
Qt, QDialog, QToolButton, QAbstractItemView, QDialogButtonBox, QFrame, QComboBox,
QLineEdit, QAction, QImage, QIODevice, QPalette, QFormLayout, QEvent, QMessageBox
QLineEdit, QAction, QImage, QIODevice, QPalette, QFormLayout, QEvent, QMessageBox,
QSizePolicy, QLayout
):
for var in tuple(vars(cls).values()):
m = getattr(var, '__members__', {})