diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-03 18:42:30 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-04 08:37:59 +0200 |
commit | 00a5629d8de18bc1a5dfb6e2526c03b4b021c903 (patch) | |
tree | d444ede3eb66e5455e09c4de3fda32bcd7437a4a /examples/widgets/painting/fontsampler | |
parent | 6b171dc6c0c0f0a822b212df77b58b28bd92716c (diff) |
Remove deprecated QPrinter and QPagedPaintDevice APIs
Adjusting the QPrinter test case - some use cases no longer exist, or are
already tested in QPageSize and QPageLayout tests.
Adjust examples and manual tests.
Change-Id: I01cbc65f3d8031aea2dac86dd942126ba708b111
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'examples/widgets/painting/fontsampler')
-rw-r--r-- | examples/widgets/painting/fontsampler/mainwindow.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp index 96258a66d0..65a186099d 100644 --- a/examples/widgets/painting/fontsampler/mainwindow.cpp +++ b/examples/widgets/painting/fontsampler/mainwindow.cpp @@ -320,16 +320,16 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) } } - qreal xScale = printer->pageRect().width() / width; - qreal yScale = printer->pageRect().height() / height; + qreal xScale = printer->pageRect(QPrinter::DevicePixel).width() / width; + qreal yScale = printer->pageRect(QPrinter::DevicePixel).height() / height; qreal scale = qMin(xScale, yScale); - qreal remainingHeight = printer->pageRect().height()/scale - height; + qreal remainingHeight = printer->pageRect(QPrinter::DevicePixel).height()/scale - height; qreal spaceHeight = (remainingHeight / 4.0) / (items.count() + 1); qreal interLineHeight = (remainingHeight / 4.0) / (sampleSizes.count() * items.count()); painter->save(); - painter->translate(printer->pageRect().width() / 2.0, printer->pageRect().height() / 2.0); + painter->translate(printer->pageRect(QPrinter::DevicePixel).width() / 2.0, printer->pageRect(QPrinter::DevicePixel).height() / 2.0); painter->scale(scale, scale); painter->setBrush(QBrush(Qt::black)); |