summaryrefslogtreecommitdiffstats
path: root/src/printsupport/widgets/qprintpreviewwidget.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-03 18:42:30 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-04 08:37:59 +0200
commit00a5629d8de18bc1a5dfb6e2526c03b4b021c903 (patch)
treed444ede3eb66e5455e09c4de3fda32bcd7437a4a /src/printsupport/widgets/qprintpreviewwidget.cpp
parent6b171dc6c0c0f0a822b212df77b58b28bd92716c (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 'src/printsupport/widgets/qprintpreviewwidget.cpp')
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.cpp18
1 files changed, 8 insertions, 10 deletions
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);
}
/*!