Skip to content

Commit

Permalink
Remove Qt printer deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chromatic committed Mar 2, 2024
1 parent 2a1ef86 commit bdd17a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/qt/utilitydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <QCloseEvent>
#include <QFont>
#include <QLabel>
#include <QPageSize>
#include <QRegExp>
#include <QTextTable>
#include <QTextCursor>
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit bdd17a6

Please sign in to comment.