mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More stupid PyQt enums
This commit is contained in:
parent
15407e24ab
commit
7709deb8d5
@ -5,7 +5,7 @@
|
||||
|
||||
from PyQt5.Qt import (
|
||||
QApplication, QBrush, QColor, QFont, QFontMetrics, QPen, QPixmap, QSplashScreen,
|
||||
Qt
|
||||
Qt, QPainter
|
||||
)
|
||||
|
||||
from calibre.constants import __appname__, numeric_version
|
||||
@ -55,8 +55,8 @@ class SplashScreen(QSplashScreen):
|
||||
def drawContents(self, painter):
|
||||
self.drawn_once = True
|
||||
painter.save()
|
||||
painter.setRenderHint(painter.TextAntialiasing, True)
|
||||
painter.setRenderHint(painter.Antialiasing, True)
|
||||
painter.setRenderHint(QPainter.RenderHint.TextAntialiasing, True)
|
||||
painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
|
||||
pw = self.LOGO_SIZE
|
||||
height = max(pw, self.total_height)
|
||||
width = self.width()
|
||||
|
@ -199,7 +199,7 @@ class Replace(Command):
|
||||
img = self.after_image = QImage(canvas.current_image)
|
||||
rect = QRectF(*get_selection_rect(img, canvas.selection_state.rect, canvas.target))
|
||||
p = QPainter(img)
|
||||
p.setRenderHint(p.SmoothPixmapTransform, True)
|
||||
p.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform, True)
|
||||
p.drawImage(rect, pimg, QRectF(pimg.rect()))
|
||||
p.end()
|
||||
return self.after_image
|
||||
|
@ -40,7 +40,7 @@ def create_icon(text, palette=None, sz=None, divider=2, fill='white'):
|
||||
img = QImage(sz, sz, QImage.Format.Format_ARGB32)
|
||||
img.fill(Qt.GlobalColor.transparent)
|
||||
p = QPainter(img)
|
||||
p.setRenderHints(p.TextAntialiasing | p.Antialiasing)
|
||||
p.setRenderHints(QPainter.RenderHint.TextAntialiasing | QPainter.RenderHint.Antialiasing)
|
||||
if fill is not None:
|
||||
qDrawShadeRect(p, img.rect(), palette, fill=fill, lineWidth=1, midLineWidth=1)
|
||||
f = p.font()
|
||||
|
Loading…
x
Reference in New Issue
Block a user