From 4227a7bccb5bb4186da1ff51ff38ae39e4fbfdfa Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sat, 17 Apr 2021 16:00:05 -0400 Subject: [PATCH] Port away from from deprecated QPrinter::pageRect() --- src/widgets/KonsolePrintManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/KonsolePrintManager.cpp b/src/widgets/KonsolePrintManager.cpp index 243b4ac2..b2031da3 100644 --- a/src/widgets/KonsolePrintManager.cpp +++ b/src/widgets/KonsolePrintManager.cpp @@ -62,8 +62,9 @@ void KonsolePrintManager::printRequest(pPrintContent pContent, QWidget *parent) KConfigGroup configGroup(KSharedConfig::openConfig(), "PrintOptions"); if (configGroup.readEntry("ScaleOutput", true)) { - double scale = qMin(printer.pageRect().width() / static_cast(parent->width()), - printer.pageRect().height() / static_cast(parent->height())); + QRect page_rect = printer.pageLayout().paintRectPixels(printer.resolution()); + double scale = qMin(page_rect.width() / static_cast(parent->width()), + page_rect.height() / static_cast(parent->height())); painter.scale(scale, scale); }