mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add compat for enums from QSizePolicy and QLayout
This commit is contained in:
parent
a67fcb81f1
commit
da775a7adc
@ -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__', {})
|
||||
|
Loading…
x
Reference in New Issue
Block a user