diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2018-02-19 13:07:30 +0100 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2018-02-20 07:56:05 +0000 |
commit | d145d291cdd9f9368e047b875d1a41d131ec403a (patch) | |
tree | dc02b89baaad9d807448cc99aa7f0e3c6a71165c /src | |
parent | 4629a6b23883086eace25f87b33cd8f64952a392 (diff) |
Fix QPlatformPrintDevice::supportedPageSizeMatch
First check if the pagesize is one of the known ones before
comparing the page sizes. It's veeeery similar but without
it when running the qprinter tests i get a failure since we
set "Index Card 3x5in" but get back "Photo 3x5in"
Change-Id: I72671231c2abec39e036de829d226784f06e1b41
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/printsupport/kernel/qplatformprintdevice.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp index 8dba402a6e..46ce24eded 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -247,6 +247,10 @@ QPageSize QPlatformPrintDevice::supportedPageSize(const QSizeF &size, QPageSize: QPageSize QPlatformPrintDevice::supportedPageSizeMatch(const QPageSize &pageSize) const { + // If it's a known page size, just return itself + if (m_pageSizes.contains(pageSize)) + return pageSize; + // Try to find a supported page size based on point size for (const QPageSize &ps : m_pageSizes) { if (ps.sizePoints() == pageSize.sizePoints()) |