From 00a5629d8de18bc1a5dfb6e2526c03b4b021c903 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 3 Sep 2020 18:42:30 +0200 Subject: Remove deprecated QPrinter and QPagedPaintDevice APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø Reviewed-by: Qt CI Bot --- src/printsupport/widgets/qprintpreviewwidget.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/printsupport/widgets/qprintpreviewwidget.cpp') diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp index bd22d5a6a5..46d93c315e 100644 --- a/src/printsupport/widgets/qprintpreviewwidget.cpp +++ b/src/printsupport/widgets/qprintpreviewwidget.cpp @@ -590,22 +590,20 @@ void QPrintPreviewWidget::setViewMode(ViewMode mode) Returns the current orientation of the preview. This value is obtained from the QPrinter object associated with the preview. */ -QPrinter::Orientation QPrintPreviewWidget::orientation() const +QPageLayout::Orientation QPrintPreviewWidget::orientation() const { Q_D(const QPrintPreviewWidget); - return d->printer->pageLayout().orientation() == QPageLayout::Portrait - ? QPrinter::Portrait : QPrinter::Landscape; + return d->printer->pageLayout().orientation(); } /*! Sets the current orientation to \a orientation. This value will be set on the QPrinter object associated with the preview. */ -void QPrintPreviewWidget::setOrientation(QPrinter::Orientation orientation) +void QPrintPreviewWidget::setOrientation(QPageLayout::Orientation orientation) { Q_D(QPrintPreviewWidget); - d->printer->setPageOrientation(orientation == QPrinter::Portrait - ? QPageLayout::Portrait : QPageLayout::Landscape); + d->printer->setPageOrientation(orientation); d->generatePreview(); } @@ -744,20 +742,20 @@ QPrintPreviewWidget::ZoomMode QPrintPreviewWidget::zoomMode() const /*! This is a convenience function and is the same as calling \c - {setOrientation(QPrinter::Landscape)}. + {setOrientation(QPageLayout::Landscape)}. */ void QPrintPreviewWidget::setLandscapeOrientation() { - setOrientation(QPrinter::Landscape); + setOrientation(QPageLayout::Landscape); } /*! This is a convenience function and is the same as calling \c - {setOrientation(QPrinter::Portrait)}. + {setOrientation(QPageLayout::Portrait)}. */ void QPrintPreviewWidget::setPortraitOrientation() { - setOrientation(QPrinter::Portrait); + setOrientation(QPageLayout::Portrait); } /*! -- cgit v1.2.3