Sync QPrinter orientation when PageSetup Orientation selected

QPrinter orientation will not effect when PageSetup Orientation selected

Fix this by sync PageSetup orientation property to QPrinter.

Fixes: QTBUG-100261
Pick-to: 5.15 6.2 6.3
Change-Id: I264852ea18317308dfcfb58c880f5e8ad8d299bd
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Zhang Hao 2022-01-27 11:20:57 +08:00
parent 9e0f1b905a
commit 715ed74c89

View File

@ -529,6 +529,7 @@ void QPageSetupWidget::updateWidget()
void QPageSetupWidget::setupPrinter() const
{
m_printer->setPageLayout(m_pageLayout);
m_printer->setPageOrientation(m_pageLayout.orientation());
#if QT_CONFIG(cups)
QCUPSSupport::PagesPerSheet pagesPerSheet = qvariant_cast<QCUPSSupport::PagesPerSheet>(m_ui.pagesPerSheetCombo->currentData()
);