diff --git a/src/calibre/gui2/covers.py b/src/calibre/gui2/covers.py index 64cd4acc75..c71d56e70e 100644 --- a/src/calibre/gui2/covers.py +++ b/src/calibre/gui2/covers.py @@ -177,7 +177,7 @@ class CoverSettingsWidget(QWidget): def add_hline(): f = QFrame() fp.f.append(f) - f.setFrameShape(f.HLine) + f.setFrameShape(QFrame.Shape.HLine) l.addRow(f) for x, label, size_label in ( diff --git a/src/calibre/gui2/dialogs/exim.py b/src/calibre/gui2/dialogs/exim.py index f2600e6093..69d05c240b 100644 --- a/src/calibre/gui2/dialogs/exim.py +++ b/src/calibre/gui2/dialogs/exim.py @@ -277,7 +277,7 @@ class EximDialog(Dialog): f = QFrame(self) self.frames.append(f) l.addWidget(f) - f.setFrameShape(f.HLine) + f.setFrameShape(QFrame.Shape.HLine) w = ImportLocation(lpath, self.slp) l.addWidget(w) self.imported_lib_widgets.append(w) diff --git a/src/calibre/gui2/dialogs/scheduler.py b/src/calibre/gui2/dialogs/scheduler.py index 45bbaa50eb..c9c8119acc 100644 --- a/src/calibre/gui2/dialogs/scheduler.py +++ b/src/calibre/gui2/dialogs/scheduler.py @@ -267,7 +267,7 @@ class SchedulerDialog(QDialog): vt.addWidget(la) self.frame = f = QFrame(self.tab) vt.addWidget(f) - f.setFrameShape(f.StyledPanel) + f.setFrameShape(QFrame.Shape.StyledPanel) f.setFrameShadow(f.Raised) f.v = vf = QVBoxLayout(f) self.schedule = s = QCheckBox(_("&Schedule for download:"), f) diff --git a/src/calibre/gui2/keyboard.py b/src/calibre/gui2/keyboard.py index f395f47d01..2e0a49b8d8 100644 --- a/src/calibre/gui2/keyboard.py +++ b/src/calibre/gui2/keyboard.py @@ -403,7 +403,7 @@ class Editor(QFrame): # {{{ self.setAutoFillBackground(True) self.capture = 0 - self.setFrameShape(self.StyledPanel) + self.setFrameShape(QFrame.Shape.StyledPanel) self.setFrameShadow(self.Raised) self._layout = l = QGridLayout(self) self.setLayout(l) diff --git a/src/calibre/gui2/library/annotations.py b/src/calibre/gui2/library/annotations.py index 4dd0e9fe22..7550dae08a 100644 --- a/src/calibre/gui2/library/annotations.py +++ b/src/calibre/gui2/library/annotations.py @@ -9,7 +9,7 @@ from functools import partial from PyQt5.Qt import ( QApplication, QCheckBox, QComboBox, QCursor, QDateTime, QFont, QFormLayout, QDialog, QHBoxLayout, QIcon, QKeySequence, QLabel, QMenu, QPalette, QPlainTextEdit, QSize, - QSplitter, Qt, QTextBrowser, QTimer, QToolButton, QTreeWidget, QTreeWidgetItem, + QSplitter, Qt, QTextBrowser, QTimer, QToolButton, QTreeWidget, QTreeWidgetItem, QFrame, QVBoxLayout, QWidget, pyqtSignal, QAbstractItemView, QDialogButtonBox ) @@ -565,7 +565,7 @@ class Details(QTextBrowser): def __init__(self, parent): QTextBrowser.__init__(self, parent) - self.setFrameShape(self.NoFrame) + self.setFrameShape(QFrame.Shape.NoFrame) self.setOpenLinks(False) self.setAttribute(Qt.WidgetAttribute.WA_OpaquePaintEvent, False) palette = self.palette() diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index 876299dc1f..d650bf0150 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -42,7 +42,7 @@ class ScrollArea(QScrollArea): def __init__(self, widget=None, parent=None): QScrollArea.__init__(self, parent) - self.setFrameShape(self.NoFrame) + self.setFrameShape(QFrame.Shape.NoFrame) self.setWidgetResizable(True) if widget is not None: self.setWidget(widget) diff --git a/src/calibre/gui2/preferences/server.py b/src/calibre/gui2/preferences/server.py index 5d6d953664..7cd640b98e 100644 --- a/src/calibre/gui2/preferences/server.py +++ b/src/calibre/gui2/preferences/server.py @@ -542,7 +542,7 @@ class Library(QWidget): l.setSizeConstraint(l.SetMinAndMaxSize) if not is_first: self.border = b = QFrame(self) - b.setFrameStyle(b.HLine) + b.setFrameStyle(QFrame.Shape.HLine) l.addWidget(b) self.cw = cw = QCheckBox(name.replace('&', '&&')) cw.setStyleSheet('QCheckBox { font-weight: bold }') diff --git a/src/calibre/gui2/search_restriction_mixin.py b/src/calibre/gui2/search_restriction_mixin.py index 02f726ae8e..f1f2559da9 100644 --- a/src/calibre/gui2/search_restriction_mixin.py +++ b/src/calibre/gui2/search_restriction_mixin.py @@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal ' from functools import partial from PyQt5.Qt import ( - Qt, QMenu, QIcon, QDialog, QGridLayout, QLabel, QLineEdit, QComboBox, + Qt, QMenu, QIcon, QDialog, QGridLayout, QLabel, QLineEdit, QComboBox, QFrame, QDialogButtonBox, QSize, QVBoxLayout, QListWidget, QRadioButton, QAction, QTextBrowser, QAbstractItemView) from calibre.gui2 import error_dialog, question_dialog, gprefs @@ -160,7 +160,7 @@ class CreateVirtualLibrary(QDialog): # {{{ ''') % localize_user_manual_link('https://manual.calibre-ebook.com/virtual_libraries.html')) hl.setWordWrap(True) hl.setOpenExternalLinks(True) - hl.setFrameStyle(hl.StyledPanel) + hl.setFrameStyle(QFrame.Shape.StyledPanel) gl.addWidget(hl, 0, 3, 4, 1) bb = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel) diff --git a/src/calibre/gui2/shortcuts.py b/src/calibre/gui2/shortcuts.py index 9eafce88ac..1c112547c9 100644 --- a/src/calibre/gui2/shortcuts.py +++ b/src/calibre/gui2/shortcuts.py @@ -29,7 +29,7 @@ class Customize(QFrame): def __init__(self, index, dup_check, parent=None): QFrame.__init__(self, parent) - self.setFrameShape(self.StyledPanel) + self.setFrameShape(QFrame.Shape.StyledPanel) self.setFrameShadow(self.Raised) self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) self.setAutoFillBackground(True) diff --git a/src/calibre/gui2/toc/location.py b/src/calibre/gui2/toc/location.py index 133e62b4c9..12a9621ea8 100644 --- a/src/calibre/gui2/toc/location.py +++ b/src/calibre/gui2/toc/location.py @@ -140,7 +140,7 @@ class ItemEdit(QWidget): b.clicked.connect(self.find_previous) self.f = f = QFrame() - f.setFrameShape(f.StyledPanel) + f.setFrameShape(QFrame.Shape.StyledPanel) f.setMinimumWidth(250) l = f.l = QVBoxLayout() f.setLayout(l) diff --git a/src/calibre/gui2/toc/main.py b/src/calibre/gui2/toc/main.py index c526422fad..a1ea5a2ba3 100644 --- a/src/calibre/gui2/toc/main.py +++ b/src/calibre/gui2/toc/main.py @@ -247,7 +247,7 @@ class ItemView(QStackedWidget): # {{{ # Item status ip.hl1 = hl = QFrame() - hl.setFrameShape(hl.HLine) + hl.setFrameShape(QFrame.Shape.HLine) l.addWidget(hl, l.rowCount(), 0, 1, 2) self.icon_label = QLabel() self.status_label = QLabel() @@ -255,7 +255,7 @@ class ItemView(QStackedWidget): # {{{ l.addWidget(self.icon_label, l.rowCount(), 0) l.addWidget(self.status_label, l.rowCount()-1, 1) ip.hl2 = hl = QFrame() - hl.setFrameShape(hl.HLine) + hl.setFrameShape(QFrame.Shape.HLine) l.addWidget(hl, l.rowCount(), 0, 1, 2) # Edit/remove item @@ -269,7 +269,7 @@ class ItemView(QStackedWidget): # {{{ l.addWidget(b, l.rowCount(), 0, 1, 2) b.clicked.connect(self.delete_item) ip.hl3 = hl = QFrame() - hl.setFrameShape(hl.HLine) + hl.setFrameShape(QFrame.Shape.HLine) l.addWidget(hl, l.rowCount(), 0, 1, 2) l.setRowMinimumHeight(rs, 20) @@ -292,7 +292,7 @@ class ItemView(QStackedWidget): # {{{ l.addWidget(b, l.rowCount()+1, 0, 1, 2) ip.hl4 = hl = QFrame() - hl.setFrameShape(hl.HLine) + hl.setFrameShape(QFrame.Shape.HLine) l.addWidget(hl, l.rowCount(), 0, 1, 2) l.setRowMinimumHeight(rs, 20) diff --git a/src/calibre/gui2/tweak_book/editor/snippets.py b/src/calibre/gui2/tweak_book/editor/snippets.py index f84ab8ca19..7ab6ab4b7b 100644 --- a/src/calibre/gui2/tweak_book/editor/snippets.py +++ b/src/calibre/gui2/tweak_book/editor/snippets.py @@ -494,7 +494,7 @@ class EditSnippet(QWidget): t.setToolTip(_('Which file types this snippet should be active in')) self.frame = f = QFrame(self) - f.setFrameShape(f.HLine) + f.setFrameShape(QFrame.Shape.HLine) add_row(f) self.test = d = SnippetTextEdit('', self) d.snippet_manager.snip_func = self.snip_func diff --git a/src/calibre/gui2/tweak_book/search.py b/src/calibre/gui2/tweak_book/search.py index fcfd019770..3ffdb58b54 100644 --- a/src/calibre/gui2/tweak_book/search.py +++ b/src/calibre/gui2/tweak_book/search.py @@ -299,7 +299,7 @@ class SearchWidget(QWidget): b.clicked.connect(self.remove_function) fhl.addWidget(b) self.fsep = f = QFrame(self) - f.setFrameShape(f.VLine) + f.setFrameShape(QFrame.Shape.VLine) fhl.addWidget(f) self.fb = fb = PushButton(_('Fin&d'), 'find', self) @@ -670,7 +670,7 @@ class EditSearch(QFrame): # {{{ def __init__(self, parent=None): QFrame.__init__(self, parent) - self.setFrameShape(self.StyledPanel) + self.setFrameShape(QFrame.Shape.StyledPanel) self.search_index = -1 self.search = {} self.original_name = None diff --git a/src/calibre/gui2/tweak_book/widgets.py b/src/calibre/gui2/tweak_book/widgets.py index 5a7fffbd96..31031e312f 100644 --- a/src/calibre/gui2/tweak_book/widgets.py +++ b/src/calibre/gui2/tweak_book/widgets.py @@ -846,7 +846,7 @@ class InsertSemantics(Dialog): l.addLayout(tl) self.hline = hl = QFrame(self) - hl.setFrameStyle(hl.HLine) + hl.setFrameStyle(QFrame.Shape.HLine) l.addWidget(hl) self.h = h = QHBoxLayout() diff --git a/src/calibre/gui2/widgets2.py b/src/calibre/gui2/widgets2.py index a5c3fce652..052769bc17 100644 --- a/src/calibre/gui2/widgets2.py +++ b/src/calibre/gui2/widgets2.py @@ -5,7 +5,7 @@ import weakref from PyQt5.Qt import ( - QApplication, QByteArray, QCalendarWidget, QCheckBox, QColor, QColorDialog, + QApplication, QByteArray, QCalendarWidget, QCheckBox, QColor, QColorDialog, QFrame, QComboBox, QDate, QDateTime, QDateTimeEdit, QDialog, QDialogButtonBox, QFont, QFontInfo, QFontMetrics, QIcon, QKeySequence, QLabel, QLayout, QMenu, QMimeData, QPalette, QPixmap, QPoint, QPushButton, QRect, QScrollArea, QSize, QSizePolicy, @@ -457,7 +457,7 @@ class HTMLDisplay(QTextBrowser): if delta: font.setPixelSize(f.pixelSize() + delta) self.setFont(font) - self.setFrameShape(self.NoFrame) + self.setFrameShape(QFrame.Shape.NoFrame) self.setOpenLinks(False) self.setAttribute(Qt.WidgetAttribute.WA_OpaquePaintEvent, False) palette = self.palette()