path: root/src
diff options
authorAlbert Astals Cid <>2018-02-19 13:07:30 +0100
committerAlbert Astals Cid <>2018-02-20 07:56:05 +0000
commitd145d291cdd9f9368e047b875d1a41d131ec403a (patch)
treedc02b89baaad9d807448cc99aa7f0e3c6a71165c /src
parent4629a6b23883086eace25f87b33cd8f64952a392 (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 <>
Diffstat (limited to 'src')
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())