diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-11-28 15:41:30 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-05-02 13:32:09 +0000 |
commit | 3e001feb4d03d350ecea76f136c503675a2431ab (patch) | |
tree | d9d45d1623cf28c232ded118b4add60e40a10490 /src/printsupport/kernel | |
parent | 3e4b7223f102c40372bd11c50ecc684597f4bf32 (diff) |
If the page size is not valid on the new printer, set a custom size
When the page size was not valid on the new printer, it would end up
having the wrong page size name on the new printer. What should happen
in this case is that it should set the originally set page size as a
custom page size on the printer instead.
Task-number: QTBUG-62221
Change-Id: Iaca34ae262f5d0685ca60e4ca4b38229a2283289
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r-- | src/printsupport/kernel/qprintengine_win.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index a943d24cb1..ca4d1d0bd6 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1234,7 +1234,10 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & if (printDevice.isValid()) { d->m_printDevice = printDevice; d->initialize(); - setProperty(PPK_QPageSize, pageSize); + if (d->m_printDevice.supportedPageSize(pageSize.value<QPageSize>()).isValid()) + setProperty(PPK_QPageSize, pageSize); + else + setProperty(PPK_CustomPaperSize, pageSize.value<QPageSize>().size(QPageSize::Point)); setProperty(PPK_FullPage, QVariant(isFullPage)); setProperty(PPK_Orientation, orientation); setProperty(PPK_QPageMargins, margins); |