mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'py3.10' of https://github.com/eli-schwartz/calibre
This commit is contained in:
commit
cf44d16964
@ -1221,7 +1221,7 @@ class Application(QApplication):
|
||||
|
||||
def signal_received(self):
|
||||
try:
|
||||
os.read(self.signal_notifier.socket(), 1024)
|
||||
os.read(int(self.signal_notifier.socket()), 1024)
|
||||
except OSError:
|
||||
return
|
||||
self.shutdown_signal_received.emit()
|
||||
|
@ -430,7 +430,7 @@ class CoverDelegate(QStyledItemDelegate):
|
||||
width = 0.75 * height
|
||||
else:
|
||||
width *= self.parent().logicalDpiX() * CM_TO_INCH
|
||||
self.cover_size = QSize(width, height)
|
||||
self.cover_size = QSize(int(width), int(height))
|
||||
self.title_height = 0
|
||||
if show_title:
|
||||
f = self.parent().font()
|
||||
|
@ -31,7 +31,7 @@ class ImageDelegate(QStyledItemDelegate):
|
||||
dpr = img.devicePixelRatio()
|
||||
scaled, nw, nh = fit_image(img.width(), img.height(), w, h)
|
||||
if scaled:
|
||||
img = img.scaled(nw*dpr, nh*dpr, Qt.AspectRatioMode.IgnoreAspectRatio, Qt.TransformationMode.SmoothTransformation)
|
||||
img = img.scaled(int(nw*dpr), int(nh*dpr), Qt.AspectRatioMode.IgnoreAspectRatio, Qt.TransformationMode.SmoothTransformation)
|
||||
iw, ih = int(img.width()/dpr), int(img.height()/dpr)
|
||||
dx, dy = (option.rect.width() - iw) // 2, (option.rect.height() - ih) // 2
|
||||
painter.drawPixmap(option.rect.adjusted(dx, dy, -dx, -dy), img)
|
||||
|
Loading…
x
Reference in New Issue
Block a user