mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pyqt6: Fix QPrinter::pageSize no longer present in pyqt6
This commit is contained in:
parent
483e976ccc
commit
3c49d08b2a
@ -10,7 +10,7 @@ from qt.core import (QIcon, QFont, QLabel, QListWidget, QAction, QEvent,
|
|||||||
QCursor, QColor, QWidget, QPixmap, QSplitterHandle, QToolButton,
|
QCursor, QColor, QWidget, QPixmap, QSplitterHandle, QToolButton,
|
||||||
Qt, pyqtSignal, QSize, QSplitter, QPainter, QPageSize, QPrinter,
|
Qt, pyqtSignal, QSize, QSplitter, QPainter, QPageSize, QPrinter,
|
||||||
QLineEdit, QComboBox, QPen, QGraphicsScene, QMenu, QStringListModel, QKeySequence,
|
QLineEdit, QComboBox, QPen, QGraphicsScene, QMenu, QStringListModel, QKeySequence,
|
||||||
QCompleter, QTimer, QRect, QGraphicsView, QPagedPaintDevice, QPalette, QClipboard)
|
QCompleter, QTimer, QRect, QGraphicsView, QPalette, QClipboard)
|
||||||
|
|
||||||
from calibre.constants import iswindows, ismacos
|
from calibre.constants import iswindows, ismacos
|
||||||
from calibre.gui2 import (error_dialog, pixmap_to_data, gprefs,
|
from calibre.gui2 import (error_dialog, pixmap_to_data, gprefs,
|
||||||
@ -1275,7 +1275,7 @@ class PaperSizes(QComboBox): # {{{
|
|||||||
if iswindows or ismacos:
|
if iswindows or ismacos:
|
||||||
# On Linux, this can cause Qt to load the system cups plugin
|
# On Linux, this can cause Qt to load the system cups plugin
|
||||||
# which can crash: https://bugs.launchpad.net/calibre/+bug/1861741
|
# which can crash: https://bugs.launchpad.net/calibre/+bug/1861741
|
||||||
PaperSizes.system_default_paper_size = 'letter' if QPrinter().pageSize() == QPagedPaintDevice.PageSize.Letter else 'a4'
|
PaperSizes.system_default_paper_size = 'letter' if QPrinter().pageLayout().pageSize().id() == QPageSize.PageSizeId.Letter else 'a4'
|
||||||
if not choices:
|
if not choices:
|
||||||
from calibre.ebooks.conversion.plugins.pdf_output import PAPER_SIZES
|
from calibre.ebooks.conversion.plugins.pdf_output import PAPER_SIZES
|
||||||
choices = PAPER_SIZES
|
choices = PAPER_SIZES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user