From bdd17a6b37579d8f30e6e78234d786ee135f596e Mon Sep 17 00:00:00 2001 From: chromatic Date: Fri, 1 Mar 2024 18:08:39 -0800 Subject: [PATCH] Remove Qt printer deprecation warnings --- src/qt/utilitydialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index ec9e3766256..de6a9e092ce 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -349,8 +350,8 @@ void PaperWalletDialog::on_printButton_clicked() } - printer.setOrientation(QPrinter::Portrait); - printer.setPaperSize(QPrinter::A4); + printer.setPageOrientation(QPageLayout::Portrait); + printer.setPageSize(QPageSize(QPageSize::A4)); printer.setFullPage(true); QPainter painter; @@ -362,7 +363,7 @@ void PaperWalletDialog::on_printButton_clicked() int walletCount = ui->walletCount->currentIndex() + 1; int walletsPerPage = 4; - int pageHeight = printer.pageRect().height() - PAPER_WALLET_PAGE_MARGIN; + int pageHeight = printer.pageLayout().paintRectPoints().height() - PAPER_WALLET_PAGE_MARGIN; int walletHeight = ui->paperTemplate->height(); double computedWalletHeight = 0.9 * pageHeight / walletsPerPage; double scale = computedWalletHeight / walletHeight;