More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-20 11:01:10 +05:30
parent e68867bc23
commit 281da620c2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
15 changed files with 22 additions and 22 deletions

View File

@ -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 (

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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)

View File

@ -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 }')

View File

@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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()