OpenCoverage

qpagesize.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpagesize.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2014 John Layt <jlayt@kde.org>-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qpagesize.h"-
41-
42#include <QtCore/qcoreapplication.h>-
43#include <QtCore/qdebug.h>-
44#include <QtCore/qpoint.h>-
45#include <QtCore/qrect.h>-
46#include <QtCore/qsize.h>-
47#include <QtCore/qstring.h>-
48-
49QT_BEGIN_NAMESPACE-
50-
51// Define the Windows DMPAPER sizes for use in the look-up table-
52// See http://msdn.microsoft.com/en-us/library/windows/desktop/dd319099.aspx-
53-
54enum WindowsDmPaper {-
55 DMPAPER_NONE = 0, // Not a DMPAPER, use for sizes without a DMPAPER value-
56 DMPAPER_LETTER = 1,-
57 DMPAPER_LETTERSMALL = 2,-
58 DMPAPER_TABLOID = 3,-
59 DMPAPER_LEDGER = 4,-
60 DMPAPER_LEGAL = 5,-
61 DMPAPER_STATEMENT = 6,-
62 DMPAPER_EXECUTIVE = 7,-
63 DMPAPER_A3 = 8,-
64 DMPAPER_A4 = 9,-
65 DMPAPER_A4SMALL = 10,-
66 DMPAPER_A5 = 11,-
67 DMPAPER_B4 = 12,-
68 DMPAPER_B5 = 13,-
69 DMPAPER_FOLIO = 14,-
70 DMPAPER_QUARTO = 15,-
71 DMPAPER_10X14 = 16,-
72 DMPAPER_11X17 = 17,-
73 DMPAPER_NOTE = 18,-
74 DMPAPER_ENV_9 = 19,-
75 DMPAPER_ENV_10 = 20,-
76 DMPAPER_ENV_11 = 21,-
77 DMPAPER_ENV_12 = 22,-
78 DMPAPER_ENV_14 = 23,-
79 DMPAPER_CSHEET = 24,-
80 DMPAPER_DSHEET = 25,-
81 DMPAPER_ESHEET = 26,-
82 DMPAPER_ENV_DL = 27,-
83 DMPAPER_ENV_C5 = 28,-
84 DMPAPER_ENV_C3 = 29,-
85 DMPAPER_ENV_C4 = 30,-
86 DMPAPER_ENV_C6 = 31,-
87 DMPAPER_ENV_C65 = 32,-
88 DMPAPER_ENV_B4 = 33,-
89 DMPAPER_ENV_B5 = 34,-
90 DMPAPER_ENV_B6 = 35,-
91 DMPAPER_ENV_ITALY = 36,-
92 DMPAPER_ENV_MONARCH = 37,-
93 DMPAPER_ENV_PERSONAL = 38,-
94 DMPAPER_FANFOLD_US = 39,-
95 DMPAPER_FANFOLD_STD_GERMAN = 40,-
96 DMPAPER_FANFOLD_LGL_GERMAN = 41,-
97 DMPAPER_ISO_B4 = 42,-
98 DMPAPER_JAPANESE_POSTCARD = 43,-
99 DMPAPER_9X11 = 44,-
100 DMPAPER_10X11 = 45,-
101 DMPAPER_15X11 = 46,-
102 DMPAPER_ENV_INVITE = 47,-
103 DMPAPER_RESERVED_48 = 48,-
104 DMPAPER_RESERVED_49 = 49,-
105 DMPAPER_LETTER_EXTRA = 50,-
106 DMPAPER_LEGAL_EXTRA = 51,-
107 DMPAPER_TABLOID_EXTRA = 52,-
108 DMPAPER_A4_EXTRA = 53,-
109 DMPAPER_LETTER_TRANSVERSE = 54,-
110 DMPAPER_A4_TRANSVERSE = 55,-
111 DMPAPER_LETTER_EXTRA_TRANSVERSE = 56,-
112 DMPAPER_A_PLUS = 57,-
113 DMPAPER_B_PLUS = 58,-
114 DMPAPER_LETTER_PLUS = 59,-
115 DMPAPER_A4_PLUS = 60,-
116 DMPAPER_A5_TRANSVERSE = 61,-
117 DMPAPER_B5_TRANSVERSE = 62,-
118 DMPAPER_A3_EXTRA = 63,-
119 DMPAPER_A5_EXTRA = 64,-
120 DMPAPER_B5_EXTRA = 65,-
121 DMPAPER_A2 = 66,-
122 DMPAPER_A3_TRANSVERSE = 67,-
123 DMPAPER_A3_EXTRA_TRANSVERSE = 68,-
124 DMPAPER_DBL_JAPANESE_POSTCARD = 69,-
125 DMPAPER_A6 = 70,-
126 DMPAPER_JENV_KAKU2 = 71,-
127 DMPAPER_JENV_KAKU3 = 72,-
128 DMPAPER_JENV_CHOU3 = 73,-
129 DMPAPER_JENV_CHOU4 = 74,-
130 DMPAPER_LETTER_ROTATED = 75,-
131 DMPAPER_A3_ROTATED = 76,-
132 DMPAPER_A4_ROTATED = 77,-
133 DMPAPER_A5_ROTATED = 78,-
134 DMPAPER_B4_JIS_ROTATED = 79,-
135 DMPAPER_B5_JIS_ROTATED = 80,-
136 DMPAPER_JAPANESE_POSTCARD_ROTATED = 81,-
137 DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED = 82,-
138 DMPAPER_A6_ROTATED = 83,-
139 DMPAPER_JENV_KAKU2_ROTATED = 84,-
140 DMPAPER_JENV_KAKU3_ROTATED = 85,-
141 DMPAPER_JENV_CHOU3_ROTATED = 86,-
142 DMPAPER_JENV_CHOU4_ROTATED = 87,-
143 DMPAPER_B6_JIS = 88,-
144 DMPAPER_B6_JIS_ROTATED = 89,-
145 DMPAPER_12X11 = 90,-
146 DMPAPER_JENV_YOU4 = 91,-
147 DMPAPER_JENV_YOU4_ROTATED = 92,-
148 DMPAPER_P16K = 93,-
149 DMPAPER_P32K = 94,-
150 DMPAPER_P32KBIG = 95,-
151 DMPAPER_PENV_1 = 96,-
152 DMPAPER_PENV_2 = 97,-
153 DMPAPER_PENV_3 = 98,-
154 DMPAPER_PENV_4 = 99,-
155 DMPAPER_PENV_5 = 100,-
156 DMPAPER_PENV_6 = 101,-
157 DMPAPER_PENV_7 = 102,-
158 DMPAPER_PENV_8 = 103,-
159 DMPAPER_PENV_9 = 104,-
160 DMPAPER_PENV_10 = 105,-
161 DMPAPER_P16K_ROTATED = 106,-
162 DMPAPER_P32K_ROTATED = 107,-
163 DMPAPER_P32KBIG_ROTATED = 108,-
164 DMPAPER_PENV_1_ROTATED = 109,-
165 DMPAPER_PENV_2_ROTATED = 110,-
166 DMPAPER_PENV_3_ROTATED = 111,-
167 DMPAPER_PENV_4_ROTATED = 112,-
168 DMPAPER_PENV_5_ROTATED = 113,-
169 DMPAPER_PENV_6_ROTATED = 114,-
170 DMPAPER_PENV_7_ROTATED = 115,-
171 DMPAPER_PENV_8_ROTATED = 116,-
172 DMPAPER_PENV_9_ROTATED = 117,-
173 DMPAPER_PENV_10_ROTATED = 118,-
174 DMPAPER_LAST = DMPAPER_PENV_10_ROTATED,-
175 DMPAPER_USER = 256-
176};-
177-
178// Conversion table for historic page size values that we don't support.-
179// These are deprecated in PPD and strongly discouraged from being used,-
180// so convert them to usable page sizes to support older print devices.-
181// The paper source orientation will be handled in the QPrintMedia class,-
182// we're only concerned about the standard size in QPageSize.-
183// _ROTATED = 90 degrees or QPageLayout::Landscape-
184// _TRANSVERSE = 180 degrees or QPageLayout::ReversePortrait-
185-
186static const int qt_windowsConversion[][2] = {-
187 {DMPAPER_11X17, DMPAPER_TABLOID}, // = DMPAPER_LEDGER rotated-
188 {DMPAPER_A3_EXTRA_TRANSVERSE, DMPAPER_A3_EXTRA},-
189 {DMPAPER_A3_ROTATED, DMPAPER_A3},-
190 {DMPAPER_A3_TRANSVERSE, DMPAPER_A3},-
191 {DMPAPER_A4_ROTATED, DMPAPER_A4},-
192 {DMPAPER_A4_TRANSVERSE, DMPAPER_A4},-
193 {DMPAPER_A5_ROTATED, DMPAPER_A5},-
194 {DMPAPER_A5_TRANSVERSE, DMPAPER_A5},-
195 {DMPAPER_A6_ROTATED, DMPAPER_A6},-
196 {DMPAPER_B4_JIS_ROTATED, DMPAPER_B4},-
197 {DMPAPER_B5_JIS_ROTATED, DMPAPER_B5},-
198 {DMPAPER_B5_TRANSVERSE, DMPAPER_B5},-
199 {DMPAPER_B6_JIS_ROTATED, DMPAPER_B6_JIS},-
200 {DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED, DMPAPER_DBL_JAPANESE_POSTCARD},-
201 {DMPAPER_JAPANESE_POSTCARD_ROTATED, DMPAPER_JAPANESE_POSTCARD},-
202 {DMPAPER_JENV_CHOU3_ROTATED, DMPAPER_JENV_CHOU3},-
203 {DMPAPER_JENV_CHOU4_ROTATED, DMPAPER_JENV_CHOU4},-
204 {DMPAPER_JENV_KAKU2_ROTATED, DMPAPER_JENV_KAKU2},-
205 {DMPAPER_JENV_KAKU3_ROTATED, DMPAPER_JENV_KAKU3},-
206 {DMPAPER_JENV_YOU4_ROTATED, DMPAPER_JENV_YOU4},-
207 {DMPAPER_LETTER_EXTRA_TRANSVERSE, DMPAPER_LETTER_EXTRA},-
208 {DMPAPER_LETTER_ROTATED, DMPAPER_LETTER},-
209 {DMPAPER_LETTER_TRANSVERSE, DMPAPER_LETTER},-
210 {DMPAPER_P16K_ROTATED, DMPAPER_P16K},-
211 {DMPAPER_P32K_ROTATED, DMPAPER_P32K},-
212 {DMPAPER_P32KBIG_ROTATED, DMPAPER_P32KBIG},-
213 {DMPAPER_PENV_1_ROTATED, DMPAPER_PENV_1},-
214 {DMPAPER_PENV_2_ROTATED, DMPAPER_PENV_2},-
215 {DMPAPER_PENV_3_ROTATED, DMPAPER_PENV_3},-
216 {DMPAPER_PENV_4_ROTATED, DMPAPER_PENV_4},-
217 {DMPAPER_PENV_5_ROTATED, DMPAPER_PENV_5},-
218 {DMPAPER_PENV_6_ROTATED, DMPAPER_PENV_6},-
219 {DMPAPER_PENV_7_ROTATED, DMPAPER_PENV_7},-
220 {DMPAPER_PENV_8_ROTATED, DMPAPER_PENV_8},-
221 {DMPAPER_PENV_9_ROTATED, DMPAPER_PENV_9},-
222 {DMPAPER_PENV_10_ROTATED, DMPAPER_PENV_10} // Is = DMPAPER_LAST, use as loop terminator-
223};-
224-
225static const int windowsConversionCount = int(sizeof(qt_windowsConversion) / sizeof(qt_windowsConversion[0]));-
226-
227// Standard sizes data-
228struct StandardPageSize {-
229 QPageSize::PageSizeId id;-
230 int windowsId; // Windows DMPAPER value-
231 QPageSize::Unit definitionUnits; // Standard definition size, e.g. ISO uses mm, ANSI uses inches-
232 int widthPoints;-
233 int heightPoints;-
234 qreal widthMillimeters;-
235 qreal heightMillimeters;-
236 qreal widthInches;-
237 qreal heightInches;-
238 const char *mediaOption; // PPD standard mediaOption ID-
239};-
240-
241// Standard page sizes taken from the Postscript PPD Standard v4.3-
242// See http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf-
243// Excludes all Transverse and Rotated sizes-
244// NB! This table needs to be in sync with QPageSize::PageSizeId-
245static const StandardPageSize qt_pageSizes[] = {-
246-
247 // Existing Qt sizes including ISO, US, ANSI and other standards-
248 {QPageSize::A4 , DMPAPER_A4 , QPageSize::Millimeter, 595, 842, 210 , 297 , 8.27, 11.69, "A4"},-
249 {QPageSize::B5 , DMPAPER_NONE , QPageSize::Millimeter, 499, 709, 176 , 250 , 6.9 , 9.8 , "ISOB5"},-
250 {QPageSize::Letter , DMPAPER_LETTER , QPageSize::Inch , 612, 792, 215.9, 279.4, 8.5 , 11 , "Letter"},-
251 {QPageSize::Legal , DMPAPER_LEGAL , QPageSize::Inch , 612, 1008, 215.9, 355.6, 8.5 , 14 , "Legal"},-
252 {QPageSize::Executive , DMPAPER_NONE , QPageSize::Inch , 540, 720, 190.5, 254 , 7.5 , 10 , "Executive.7.5x10in"}, // Qt size differs from Postscript / Windows-
253 {QPageSize::A0 , DMPAPER_NONE , QPageSize::Millimeter, 2384, 3370, 841 , 1189 , 33.11, 46.81, "A0"},-
254 {QPageSize::A1 , DMPAPER_NONE , QPageSize::Millimeter, 1684, 2384, 594 , 841 , 23.39, 33.11, "A1"},-
255 {QPageSize::A2 , DMPAPER_A2 , QPageSize::Millimeter, 1191, 1684, 420 , 594 , 16.54, 23.39, "A2"},-
256 {QPageSize::A3 , DMPAPER_A3 , QPageSize::Millimeter, 842, 1191, 297 , 420 , 11.69, 16.54, "A3"},-
257 {QPageSize::A5 , DMPAPER_A5 , QPageSize::Millimeter, 420, 595, 148 , 210 , 5.83, 8.27, "A5"},-
258 {QPageSize::A6 , DMPAPER_A6 , QPageSize::Millimeter, 297, 420, 105 , 148 , 4.13, 5.83, "A6"},-
259 {QPageSize::A7 , DMPAPER_NONE , QPageSize::Millimeter, 210, 297, 74 , 105 , 2.91, 4.13, "A7"},-
260 {QPageSize::A8 , DMPAPER_NONE , QPageSize::Millimeter, 148, 210, 52 , 74 , 2.05, 2.91, "A8"},-
261 {QPageSize::A9 , DMPAPER_NONE , QPageSize::Millimeter, 105, 148, 37 , 52 , 1.46, 2.05, "A9"},-
262 {QPageSize::B0 , DMPAPER_NONE , QPageSize::Millimeter, 2835, 4008, 1000 , 1414 , 39.37, 55.67, "ISOB0"},-
263 {QPageSize::B1 , DMPAPER_NONE , QPageSize::Millimeter, 2004, 2835, 707 , 1000 , 27.83, 39.37, "ISOB1"},-
264 {QPageSize::B10 , DMPAPER_NONE , QPageSize::Millimeter, 88, 125, 31 , 44 , 1.22, 1.73, "ISOB10"},-
265 {QPageSize::B2 , DMPAPER_NONE , QPageSize::Millimeter, 1417, 2004, 500 , 707 , 19.68, 27.83, "ISOB2"},-
266 {QPageSize::B3 , DMPAPER_NONE , QPageSize::Millimeter, 1001, 1417, 353 , 500 , 13.9 , 19.68, "ISOB3"},-
267 {QPageSize::B4 , DMPAPER_ISO_B4 , QPageSize::Millimeter, 709, 1001, 250 , 353 , 9.84, 13.9 , "ISOB4"},-
268 {QPageSize::B6 , DMPAPER_NONE , QPageSize::Millimeter, 354, 499, 125 , 176 , 4.92, 6.93, "ISOB6"},-
269 {QPageSize::B7 , DMPAPER_NONE , QPageSize::Millimeter, 249, 354, 88 , 125 , 3.46, 4.92, "ISOB7"},-
270 {QPageSize::B8 , DMPAPER_NONE , QPageSize::Millimeter, 176, 249, 62 , 88 , 2.44, 3.46, "ISOB8"},-
271 {QPageSize::B9 , DMPAPER_NONE , QPageSize::Millimeter, 125, 176, 44 , 62 , 1.73, 2.44, "ISOB9"},-
272 {QPageSize::C5E , DMPAPER_ENV_C5 , QPageSize::Millimeter, 459, 649, 162 , 229 , 6.38, 9.02, "EnvC5"},-
273 {QPageSize::Comm10E , DMPAPER_ENV_10 , QPageSize::Inch , 297, 684, 104.8, 241.3, 4.12, 9.5 , "Env10"},-
274 {QPageSize::DLE , DMPAPER_ENV_DL , QPageSize::Millimeter, 312, 624, 110 , 220 , 4.33, 8.66, "EnvDL"},-
275 {QPageSize::Folio , DMPAPER_NONE , QPageSize::Millimeter, 595, 935, 210 , 330 , 8.27, 13 , "Folio"},-
276 {QPageSize::Ledger , DMPAPER_LEDGER , QPageSize::Inch , 1224, 792, 431.8, 279.4, 17 , 11 , "Ledger"},-
277 {QPageSize::Tabloid , DMPAPER_TABLOID , QPageSize::Inch , 792, 1224, 279.4, 431.8, 11 , 17 , "Tabloid"},-
278 {QPageSize::Custom , DMPAPER_USER , QPageSize::Millimeter, -1, -1, -1. , -1 , -1 , -1 , "Custom"}, // Special case to keep in sync with QPageSize::PageSizeId-
279-
280 // ISO Standard Sizes-
281 {QPageSize::A10 , DMPAPER_NONE , QPageSize::Millimeter, 73, 105, 26 , 37 , 1.02, 1.46, "A10"},-
282 {QPageSize::A3Extra , DMPAPER_A3_EXTRA , QPageSize::Millimeter, 913, 1262, 322 , 445 , 12.67, 17.52, "A3Extra"},-
283 {QPageSize::A4Extra , DMPAPER_A4_EXTRA , QPageSize::Millimeter, 667, 914, 235.5, 322.3, 9.27, 12.69, "A4Extra"},-
284 {QPageSize::A4Plus , DMPAPER_A4_PLUS , QPageSize::Millimeter, 595, 936, 210 , 330 , 8.27, 13 , "A4Plus"},-
285 {QPageSize::A4Small , DMPAPER_A4SMALL , QPageSize::Millimeter, 595, 842, 210 , 297 , 8.27, 11.69, "A4Small"},-
286 {QPageSize::A5Extra , DMPAPER_A5_EXTRA , QPageSize::Millimeter, 492, 668, 174 , 235 , 6.85, 9.25, "A5Extra"},-
287 {QPageSize::B5Extra , DMPAPER_B5_EXTRA , QPageSize::Millimeter, 570, 782, 201 , 276 , 7.9 , 10.8 , "ISOB5Extra"},-
288-
289 // JIS Standard Sizes-
290 {QPageSize::JisB0 , DMPAPER_NONE , QPageSize::Millimeter, 2920, 4127, 1030 , 1456 , 40.55, 57.32, "B0"},-
291 {QPageSize::JisB1 , DMPAPER_NONE , QPageSize::Millimeter, 2064, 2920, 728 , 1030 , 28.66, 40.55, "B1"},-
292 {QPageSize::JisB2 , DMPAPER_NONE , QPageSize::Millimeter, 1460, 2064, 515 , 728 , 20.28, 28.66, "B2"},-
293 {QPageSize::JisB3 , DMPAPER_NONE , QPageSize::Millimeter, 1032, 1460, 364 , 515 , 14.33, 20.28, "B3"},-
294 {QPageSize::JisB4 , DMPAPER_B4 , QPageSize::Millimeter, 729, 1032, 257 , 364 , 10.12, 14.33, "B4"},-
295 {QPageSize::JisB5 , DMPAPER_B5 , QPageSize::Millimeter, 516, 729, 182 , 257 , 7.17, 10.12, "B5"},-
296 {QPageSize::JisB6 , DMPAPER_B6_JIS , QPageSize::Millimeter, 363, 516, 128 , 182 , 5.04, 7.17, "B6"},-
297 {QPageSize::JisB7 , DMPAPER_NONE , QPageSize::Millimeter, 258, 363, 91 , 128 , 3.58, 5.04, "B7"},-
298 {QPageSize::JisB8 , DMPAPER_NONE , QPageSize::Millimeter, 181, 258, 64 , 91 , 2.52, 3.58, "B8"},-
299 {QPageSize::JisB9 , DMPAPER_NONE , QPageSize::Millimeter, 127, 181, 45 , 64 , 1.77, 2.52, "B9"},-
300 {QPageSize::JisB10 , DMPAPER_NONE , QPageSize::Millimeter, 91, 127, 32 , 45 , 1.26, 1.77, "B10"},-
301-
302 // ANSI / US Standard sizes-
303 {QPageSize::AnsiC , DMPAPER_NONE , QPageSize::Inch , 1224, 1584, 431.8, 558.8, 17 , 22 , "AnsiC"},-
304 {QPageSize::AnsiD , DMPAPER_NONE , QPageSize::Inch , 1584, 2448, 558.8, 863.6, 22 , 34 , "AnsiD"},-
305 {QPageSize::AnsiE , DMPAPER_NONE , QPageSize::Inch , 2448, 3168, 863.6, 1118 , 34 , 44 , "AnsiE"},-
306 {QPageSize::LegalExtra , DMPAPER_LEGAL_EXTRA , QPageSize::Inch , 684, 1080, 241.3, 381 , 9.5 , 15 , "LegalExtra"},-
307 {QPageSize::LetterExtra , DMPAPER_LETTER_EXTRA , QPageSize::Inch , 684, 864, 241.3, 304.8, 9.5 , 12 , "LetterExtra"},-
308 {QPageSize::LetterPlus , DMPAPER_LETTER_PLUS , QPageSize::Inch , 612, 914, 215.9, 322.3, 8.5 , 12.69, "LetterPlus"},-
309 {QPageSize::LetterSmall , DMPAPER_LETTERSMALL , QPageSize::Inch , 612, 792, 215.9, 279.4, 8.5 , 11 , "LetterSmall"},-
310 {QPageSize::TabloidExtra , DMPAPER_TABLOID_EXTRA , QPageSize::Inch , 864, 1296, 304.8, 457.2, 12 , 18 , "TabloidExtra"},-
311-
312 // Architectural sizes-
313 {QPageSize::ArchA , DMPAPER_NONE , QPageSize::Inch , 648, 864, 228.6, 304.8, 9 , 12 , "ARCHA"},-
314 {QPageSize::ArchB , DMPAPER_NONE , QPageSize::Inch , 864, 1296, 304.8, 457.2, 12 , 18 , "ARCHB"},-
315 {QPageSize::ArchC , DMPAPER_CSHEET , QPageSize::Inch , 1296, 1728, 457.2, 609.6, 18 , 24 , "ARCHC"},-
316 {QPageSize::ArchD , DMPAPER_DSHEET , QPageSize::Inch , 1728, 2592, 609.6, 914.4, 24 , 36 , "ARCHD"},-
317 {QPageSize::ArchE , DMPAPER_ESHEET , QPageSize::Inch , 2592, 3456, 914.4, 1219 , 36 , 48 , "ARCHE"},-
318-
319 // Inch-based Sizes-
320 {QPageSize::Imperial7x9 , DMPAPER_NONE , QPageSize::Inch , 504, 648, 177.8, 228.6, 7 , 9 , "7x9"},-
321 {QPageSize::Imperial8x10 , DMPAPER_NONE , QPageSize::Inch , 576, 720, 203.2, 254 , 8 , 10 , "8x10"},-
322 {QPageSize::Imperial9x11 , DMPAPER_9X11 , QPageSize::Inch , 648, 792, 228.6, 279.4, 9 , 11 , "9x11"},-
323 {QPageSize::Imperial9x12 , DMPAPER_NONE , QPageSize::Inch , 648, 864, 228.6, 304.8, 9 , 12 , "9x12"},-
324 {QPageSize::Imperial10x11 , DMPAPER_10X11 , QPageSize::Inch , 720, 792, 254 , 279.4, 10 , 11 , "10x11"},-
325 {QPageSize::Imperial10x13 , DMPAPER_NONE , QPageSize::Inch , 720, 936, 254 , 330.2, 10 , 13 , "10x13"},-
326 {QPageSize::Imperial10x14 , DMPAPER_10X14 , QPageSize::Inch , 720, 1008, 254 , 355.6, 10 , 14 , "10x14"},-
327 {QPageSize::Imperial12x11 , DMPAPER_12X11 , QPageSize::Inch , 864, 792, 304.8, 279.4, 12 , 11 , "12x11"},-
328 {QPageSize::Imperial15x11 , DMPAPER_15X11 , QPageSize::Inch , 1080, 792, 381 , 279.4, 15 , 11 , "15x11"},-
329-
330 // Other Page Sizes-
331 {QPageSize::ExecutiveStandard , DMPAPER_EXECUTIVE , QPageSize::Inch , 522, 756, 184.2, 266.7, 7.25, 10.5 , "Executive"}, // Qt size differs from Postscript / Windows-
332 {QPageSize::Note , DMPAPER_NOTE , QPageSize::Inch , 612, 792, 215.9, 279.4, 8.5 , 11 , "Note"},-
333 {QPageSize::Quarto , DMPAPER_QUARTO , QPageSize::Inch , 610, 780, 215.9, 275.1, 8.5 , 10.83, "Quarto"},-
334 {QPageSize::Statement , DMPAPER_STATEMENT , QPageSize::Inch , 396, 612, 139.7, 215.9, 5.5 , 8.5 , "Statement"},-
335 {QPageSize::SuperA , DMPAPER_A_PLUS , QPageSize::Millimeter, 643, 1009, 227 , 356 , 8.94, 14 , "SuperA"},-
336 {QPageSize::SuperB , DMPAPER_B_PLUS , QPageSize::Millimeter, 864, 1380, 305 , 487 , 12 , 19.17, "SuperB"},-
337 {QPageSize::Postcard , DMPAPER_JAPANESE_POSTCARD , QPageSize::Millimeter, 284, 419, 100 , 148 , 3.94, 5.83, "Postcard"},-
338 {QPageSize::DoublePostcard , DMPAPER_DBL_JAPANESE_POSTCARD, QPageSize::Millimeter, 567, 419, 200 , 148 , 7.87, 5.83, "DoublePostcard"},-
339 {QPageSize::Prc16K , DMPAPER_P16K , QPageSize::Millimeter, 414, 610, 146 , 215 , 5.75, 8.5 , "PRC16K"},-
340 {QPageSize::Prc32K , DMPAPER_P32K , QPageSize::Millimeter, 275, 428, 97 , 151 , 3.82, 5.95, "PRC32K"},-
341 {QPageSize::Prc32KBig , DMPAPER_P32KBIG , QPageSize::Millimeter, 275, 428, 97 , 151 , 3.82, 5.95, "PRC32KBig"},-
342-
343 // Fan Fold Sizes-
344 {QPageSize::FanFoldUS , DMPAPER_FANFOLD_US , QPageSize::Inch , 1071, 792, 377.8, 279.4, 14.875, 11 , "FanFoldUS"},-
345 {QPageSize::FanFoldGerman , DMPAPER_FANFOLD_STD_GERMAN , QPageSize::Inch , 612, 864, 215.9, 304.8, 8.5 , 12 , "FanFoldGerman"},-
346 {QPageSize::FanFoldGermanLegal, DMPAPER_FANFOLD_LGL_GERMAN , QPageSize::Inch , 612, 936, 215.9, 330 , 8.5 , 13 , "FanFoldGermanLegal"},-
347-
348 // ISO Envelopes-
349 {QPageSize::EnvelopeB4 , DMPAPER_ENV_B4 , QPageSize::Millimeter, 708, 1001, 250 , 353 , 9.84, 13.9 , "EnvISOB4"},-
350 {QPageSize::EnvelopeB5 , DMPAPER_ENV_B5 , QPageSize::Millimeter, 499, 709, 176 , 250 , 6.9 , 9.8 , "EnvISOB5"},-
351 {QPageSize::EnvelopeB6 , DMPAPER_ENV_B6 , QPageSize::Millimeter, 499, 354, 176 , 125 , 6.9 , 4.9 , "EnvISOB6"},-
352 {QPageSize::EnvelopeC0 , DMPAPER_NONE , QPageSize::Millimeter, 2599, 3676, 917 , 1297 , 36.1 , 51.06, "EnvC0"},-
353 {QPageSize::EnvelopeC1 , DMPAPER_NONE , QPageSize::Millimeter, 1837, 2599, 648 , 917 , 25.51, 36.1 , "EnvC1"},-
354 {QPageSize::EnvelopeC2 , DMPAPER_NONE , QPageSize::Millimeter, 1298, 1837, 458 , 648 , 18.03, 25.51, "EnvC2"},-
355 {QPageSize::EnvelopeC3 , DMPAPER_ENV_C3 , QPageSize::Millimeter, 918, 1296, 324 , 458 , 12.75, 18.03, "EnvC3"},-
356 {QPageSize::EnvelopeC4 , DMPAPER_ENV_C4 , QPageSize::Millimeter, 649, 918, 229 , 324 , 9.02, 12.75, "EnvC4"},-
357 {QPageSize::EnvelopeC6 , DMPAPER_ENV_C6 , QPageSize::Millimeter, 323, 459, 114 , 162 , 4.49, 6.38, "EnvC6"},-
358 {QPageSize::EnvelopeC65 , DMPAPER_ENV_C65 , QPageSize::Millimeter, 324, 648, 114 , 229 , 4.5 , 9 , "EnvC65"},-
359 {QPageSize::EnvelopeC7 , DMPAPER_NONE , QPageSize::Millimeter, 230, 323, 81 , 114 , 3.19, 4.49, "EnvC7"},-
360-
361 // US Envelopes-
362 {QPageSize::Envelope9 , DMPAPER_ENV_9 , QPageSize::Inch , 279, 639, 98.4, 225.4, 3.875, 8.875, "Env9"},-
363 {QPageSize::Envelope11 , DMPAPER_ENV_11 , QPageSize::Inch , 324, 747, 114.3, 263.5, 4.5 , 10.375, "Env11"},-
364 {QPageSize::Envelope12 , DMPAPER_ENV_12 , QPageSize::Inch , 342, 792, 120.7, 279.4, 4.75, 11 , "Env12"},-
365 {QPageSize::Envelope14 , DMPAPER_ENV_14 , QPageSize::Inch , 360, 828, 127 , 292.1, 5 , 11.5 , "Env14"},-
366 {QPageSize::EnvelopeMonarch , DMPAPER_ENV_MONARCH , QPageSize::Inch , 279, 540, 98.43, 190.5, 3.875, 7.5 , "EnvMonarch"},-
367 {QPageSize::EnvelopePersonal , DMPAPER_ENV_PERSONAL , QPageSize::Inch , 261, 468, 92.08, 165.1, 3.625, 6.5 , "EnvPersonal"},-
368-
369 // Other Envelopes-
370 {QPageSize::EnvelopeChou3 , DMPAPER_JENV_CHOU3 , QPageSize::Millimeter, 340, 666, 120 , 235 , 4.72, 9.25, "EnvChou3"},-
371 {QPageSize::EnvelopeChou4 , DMPAPER_JENV_CHOU4 , QPageSize::Millimeter, 255, 581, 90 , 205 , 3.54, 8 , "EnvChou4"},-
372 {QPageSize::EnvelopeInvite , DMPAPER_ENV_INVITE , QPageSize::Millimeter, 624, 624, 220 , 220 , 8.66, 8.66, "EnvInvite"},-
373 {QPageSize::EnvelopeItalian , DMPAPER_ENV_ITALY , QPageSize::Millimeter, 312, 652, 110 , 230 , 4.33, 9 , "EnvItalian"},-
374 {QPageSize::EnvelopeKaku2 , DMPAPER_JENV_KAKU2 , QPageSize::Millimeter, 680, 941, 240 , 332 , 9.45, 13 , "EnvKaku2"},-
375 {QPageSize::EnvelopeKaku3 , DMPAPER_JENV_KAKU3 , QPageSize::Millimeter, 612, 785, 216 , 277 , 8.5 , 10.9 , "EnvKaku3"},-
376 {QPageSize::EnvelopePrc1 , DMPAPER_PENV_1 , QPageSize::Millimeter, 289, 468, 102 , 165 , 4 , 6.5 , "EnvPRC1"},-
377 {QPageSize::EnvelopePrc2 , DMPAPER_PENV_2 , QPageSize::Millimeter, 289, 499, 102 , 176 , 4 , 6.9 , "EnvPRC2"},-
378 {QPageSize::EnvelopePrc3 , DMPAPER_PENV_3 , QPageSize::Millimeter, 354, 499, 125 , 176 , 4.9 , 6.9 , "EnvPRC3"},-
379 {QPageSize::EnvelopePrc4 , DMPAPER_PENV_4 , QPageSize::Millimeter, 312, 590, 110 , 208 , 4.33, 8.2 , "EnvPRC4"},-
380 {QPageSize::EnvelopePrc5 , DMPAPER_PENV_5 , QPageSize::Millimeter, 312, 624, 110 , 220 , 4.33, 8.66, "EnvPRC5"},-
381 {QPageSize::EnvelopePrc6 , DMPAPER_PENV_6 , QPageSize::Millimeter, 340, 652, 120 , 230 , 4.7 , 9 , "EnvPRC6"},-
382 {QPageSize::EnvelopePrc7 , DMPAPER_PENV_7 , QPageSize::Millimeter, 454, 652, 160 , 230 , 6.3 , 9 , "EnvPRC7"},-
383 {QPageSize::EnvelopePrc8 , DMPAPER_PENV_8 , QPageSize::Millimeter, 340, 876, 120 , 309 , 4.7 , 12.2 , "EnvPRC8"},-
384 {QPageSize::EnvelopePrc9 , DMPAPER_PENV_9 , QPageSize::Millimeter, 649, 918, 229 , 324 , 9 , 12.75, "EnvPRC9"},-
385 {QPageSize::EnvelopePrc10 , DMPAPER_PENV_10 , QPageSize::Millimeter, 918, 1298, 324 , 458 , 12.75, 18 , "EnvPRC10"},-
386 {QPageSize::EnvelopeYou4 , DMPAPER_JENV_YOU4 , QPageSize::Millimeter, 298, 666, 105 , 235 , 4.13, 9.25, "EnvYou4"}-
387};-
388-
389static const int pageSizesCount = int(sizeof(qt_pageSizes) / sizeof(qt_pageSizes[0]));-
390Q_STATIC_ASSERT(pageSizesCount == QPageSize::LastPageSize + 1);-
391-
392// Return key name for PageSize-
393static QString qt_keyForPageSizeId(QPageSize::PageSizeId id)-
394{-
395 return QString::fromLatin1(qt_pageSizes[id].mediaOption);
never executed: return QString::fromLatin1(qt_pageSizes[id].mediaOption);
0
396}-
397-
398// Return id name for PPD Key-
399static QPageSize::PageSizeId qt_idForPpdKey(const QString &ppdKey, QSize *match = 0)-
400{-
401 if (ppdKey.isEmpty())
ppdKey.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
402 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
403 QString key = ppdKey;-
404 // Remove any Rotated or Tranverse modifiers-
405 if (key.endsWith(QLatin1String("Rotated")))
key.endsWith(Q...ng("Rotated"))Description
TRUEnever evaluated
FALSEnever evaluated
0
406 key.chop(7);
never executed: key.chop(7);
0
407 else if (key.endsWith(QLatin1String(".Transverse")))
key.endsWith(Q....Transverse"))Description
TRUEnever evaluated
FALSEnever evaluated
0
408 key.chop(11);
never executed: key.chop(11);
0
409 for (int i = 0; i <= int(QPageSize::LastPageSize); ++i) {
i <= int(QPage...:LastPageSize)Description
TRUEnever evaluated
FALSEnever evaluated
0
410 if (QLatin1String(qt_pageSizes[i].mediaOption) == key) {
QLatin1String(...Option) == keyDescription
TRUEnever evaluated
FALSEnever evaluated
0
411 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
412 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
413 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
414 }-
415 }
never executed: end of block
0
416 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
417}-
418-
419// Return id name for Windows ID-
420static QPageSize::PageSizeId qt_idForWindowsID(int windowsId, QSize *match = 0)-
421{-
422 // If outside known values then is Custom-
423 if (windowsId <= DMPAPER_NONE || windowsId > DMPAPER_LAST)
windowsId <= DMPAPER_NONEDescription
TRUEnever evaluated
FALSEnever evaluated
windowsId > DMPAPER_LASTDescription
TRUEnever evaluated
FALSEnever evaluated
0
424 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
425 // Check if one of the unsupported values, convert to valid value if is-
426 for (int i = 0; i < windowsConversionCount; ++i) {
i < windowsConversionCountDescription
TRUEnever evaluated
FALSEnever evaluated
0
427 if (qt_windowsConversion[i][0] == windowsId) {
qt_windowsConv...] == windowsIdDescription
TRUEnever evaluated
FALSEnever evaluated
0
428 windowsId = qt_windowsConversion[i][1];-
429 break;
never executed: break;
0
430 }-
431 }
never executed: end of block
0
432 // Look for the value in our supported size table-
433 for (int i = 0; i <= int(QPageSize::LastPageSize); ++i) {
i <= int(QPage...:LastPageSize)Description
TRUEnever evaluated
FALSEnever evaluated
0
434 if (qt_pageSizes[i].windowsId == windowsId) {
qt_pageSizes[i...d == windowsIdDescription
TRUEnever evaluated
FALSEnever evaluated
0
435 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
436 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
437 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
438 }-
439 }
never executed: end of block
0
440 // Otherwise is Custom-
441 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
442}-
443-
444// Return key name for custom size-
445static QString qt_keyForCustomSize(const QSizeF &size, QPageSize::Unit units)-
446{-
447 // PPD custom format-
448 QString key = QStringLiteral("Custom.%1x%2%3");
never executed: return qstring_literal_temp;
0
449 QString abbrev;-
450 switch (units) {-
451 case QPageSize::Millimeter:
never executed: case QPageSize::Millimeter:
0
452 abbrev = QStringLiteral("mm");
never executed: return qstring_literal_temp;
0
453 break;
never executed: break;
0
454 case QPageSize::Point:
never executed: case QPageSize::Point:
0
455 break;
never executed: break;
0
456 case QPageSize::Inch:
never executed: case QPageSize::Inch:
0
457 abbrev = QStringLiteral("in");
never executed: return qstring_literal_temp;
0
458 break;
never executed: break;
0
459 case QPageSize::Pica:
never executed: case QPageSize::Pica:
0
460 abbrev = QStringLiteral("pc");
never executed: return qstring_literal_temp;
0
461 break;
never executed: break;
0
462 case QPageSize::Didot:
never executed: case QPageSize::Didot:
0
463 abbrev = QStringLiteral("DD");
never executed: return qstring_literal_temp;
0
464 break;
never executed: break;
0
465 case QPageSize::Cicero:
never executed: case QPageSize::Cicero:
0
466 abbrev = QStringLiteral("CC");
never executed: return qstring_literal_temp;
0
467 break;
never executed: break;
0
468 }-
469 // Assumes size is already max 2 decimal places-
470 return key.arg(size.width()).arg(size.height()).arg(abbrev);
never executed: return key.arg(size.width()).arg(size.height()).arg(abbrev);
0
471}-
472-
473// Return localized name for custom size-
474static QString qt_nameForCustomSize(const QSizeF &size, QPageSize::Unit units)-
475{-
476 QString name;-
477 switch (units) {-
478 case QPageSize::Millimeter:
never executed: case QPageSize::Millimeter:
0
479 //: Custom size name in millimeters-
480 name = QCoreApplication::translate("QPageSize", "Custom (%1mm x %2mm)");-
481 break;
never executed: break;
0
482 case QPageSize::Point:
never executed: case QPageSize::Point:
0
483 //: Custom size name in points-
484 name = QCoreApplication::translate("QPageSize", "Custom (%1pt x %2pt)");-
485 break;
never executed: break;
0
486 case QPageSize::Inch:
never executed: case QPageSize::Inch:
0
487 //: Custom size name in inches-
488 name = QCoreApplication::translate("QPageSize", "Custom (%1in x %2in)");-
489 break;
never executed: break;
0
490 case QPageSize::Pica:
never executed: case QPageSize::Pica:
0
491 //: Custom size name in picas-
492 name = QCoreApplication::translate("QPageSize", "Custom (%1pc x %2pc)");-
493 break;
never executed: break;
0
494 case QPageSize::Didot:
never executed: case QPageSize::Didot:
0
495 //: Custom size name in didots-
496 name = QCoreApplication::translate("QPageSize", "Custom (%1DD x %2DD)");-
497 break;
never executed: break;
0
498 case QPageSize::Cicero:
never executed: case QPageSize::Cicero:
0
499 //: Custom size name in ciceros-
500 name = QCoreApplication::translate("QPageSize", "Custom (%1CC x %2CC)");-
501 break;
never executed: break;
0
502 }-
503 // Assumes size is already max 2 decimal places-
504 return name.arg(size.width()).arg(size.height());
never executed: return name.arg(size.width()).arg(size.height());
0
505}-
506-
507// Multiplier for converting units to points.-
508static qreal qt_pointMultiplier(QPageSize::Unit unit)-
509{-
510 switch (unit) {-
511 case QPageSize::Millimeter:
never executed: case QPageSize::Millimeter:
0
512 return 2.83464566929;
never executed: return 2.83464566929;
0
513 case QPageSize::Point:
never executed: case QPageSize::Point:
0
514 return 1.0;
never executed: return 1.0;
0
515 case QPageSize::Inch:
never executed: case QPageSize::Inch:
0
516 return 72.0;
never executed: return 72.0;
0
517 case QPageSize::Pica:
never executed: case QPageSize::Pica:
0
518 return 12;
never executed: return 12;
0
519 case QPageSize::Didot:
never executed: case QPageSize::Didot:
0
520 return 1.065826771;
never executed: return 1.065826771;
0
521 case QPageSize::Cicero:
never executed: case QPageSize::Cicero:
0
522 return 12.789921252;
never executed: return 12.789921252;
0
523 }-
524 return 1.0;
never executed: return 1.0;
0
525}-
526-
527// Multiplier for converting pixels to points.-
528Q_GUI_EXPORT qreal qt_pixelMultiplier(int resolution)-
529{-
530 return resolution <= 0 ? 1.0 : 72.0 / resolution;
never executed: return resolution <= 0 ? 1.0 : 72.0 / resolution;
0
531}-
532-
533static QSizeF qt_definitionSize(QPageSize::PageSizeId pageSizeId)-
534{-
535 QPageSize::Unit units = qt_pageSizes[pageSizeId].definitionUnits;-
536 if (units == QPageSize::Millimeter)
units == QPageSize::MillimeterDescription
TRUEnever evaluated
FALSEnever evaluated
0
537 return QSizeF(qt_pageSizes[pageSizeId].widthMillimeters, qt_pageSizes[pageSizeId].heightMillimeters);
never executed: return QSizeF(qt_pageSizes[pageSizeId].widthMillimeters, qt_pageSizes[pageSizeId].heightMillimeters);
0
538 Q_ASSERT(units == QPageSize::Inch); // We currently only support definitions in mm or inches-
539 return QSizeF(qt_pageSizes[pageSizeId].widthInches, qt_pageSizes[pageSizeId].heightInches);
never executed: return QSizeF(qt_pageSizes[pageSizeId].widthInches, qt_pageSizes[pageSizeId].heightInches);
0
540}-
541-
542static QSizeF qt_convertUnits(const QSizeF &size, QPageSize::Unit fromUnits, QPageSize::Unit toUnits)-
543{-
544 if (!size.isValid())
!size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
545 return QSizeF();
never executed: return QSizeF();
0
546-
547 // If the units are the same or the size is 0, then don't need to convert-
548 if (fromUnits == toUnits || (qFuzzyIsNull(size.width()) && qFuzzyIsNull(size.height())))
fromUnits == toUnitsDescription
TRUEnever evaluated
FALSEnever evaluated
qFuzzyIsNull(size.width())Description
TRUEnever evaluated
FALSEnever evaluated
qFuzzyIsNull(size.height())Description
TRUEnever evaluated
FALSEnever evaluated
0
549 return size;
never executed: return size;
0
550-
551 QSizeF newSize = size;-
552 // First convert to points-
553 if (fromUnits != QPageSize::Point) {
fromUnits != QPageSize::PointDescription
TRUEnever evaluated
FALSEnever evaluated
0
554 const qreal multiplier = qt_pointMultiplier(fromUnits);-
555 newSize = newSize * multiplier;-
556 }
never executed: end of block
0
557 // Then convert from points to required units-
558 const qreal multiplier = qt_pointMultiplier(toUnits);-
559 // Try force to 2 decimal places for consistency-
560 const int width = qRound(newSize.width() * 100 / multiplier);-
561 const int height = qRound(newSize.height() * 100 / multiplier);-
562 return QSizeF(width / 100.0, height / 100.0);
never executed: return QSizeF(width / 100.0, height / 100.0);
0
563}-
564-
565static QSize qt_convertUnitsToPoints(const QSizeF &size, QPageSize::Unit units)-
566{-
567 if (!size.isValid())
!size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
568 return QSize();
never executed: return QSize();
0
569 return QSizeF(size * qt_pointMultiplier(units)).toSize();
never executed: return QSizeF(size * qt_pointMultiplier(units)).toSize();
0
570}-
571-
572static QSize qt_convertPointsToPixels(const QSize &size, int resolution)-
573{-
574 if (!size.isValid() || resolution <= 0)
!size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
resolution <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
575 return QSize();
never executed: return QSize();
0
576 const qreal multiplier = qt_pixelMultiplier(resolution);-
577 return QSize(qRound(size.width() / multiplier), qRound(size.height() / multiplier));
never executed: return QSize(qRound(size.width() / multiplier), qRound(size.height() / multiplier));
0
578}-
579-
580static QSizeF qt_convertPointsToUnits(const QSize &size, QPageSize::Unit units)-
581{-
582 if (!size.isValid())
!size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
583 return QSizeF();
never executed: return QSizeF();
0
584 const qreal multiplier = qt_pointMultiplier(units);-
585 // Try force to 2 decimal places for consistency-
586 const int width = qRound(size.width() * 100 / multiplier);-
587 const int height = qRound(size.height() * 100 / multiplier);-
588 return QSizeF(width / 100.0, height / 100.0);
never executed: return QSizeF(width / 100.0, height / 100.0);
0
589}-
590-
591static QSizeF qt_unitSize(QPageSize::PageSizeId pageSizeId, QPageSize::Unit units)-
592{-
593 switch (units) {-
594 case QPageSize::Millimeter:
never executed: case QPageSize::Millimeter:
0
595 return QSizeF(qt_pageSizes[pageSizeId].widthMillimeters, qt_pageSizes[pageSizeId].heightMillimeters);
never executed: return QSizeF(qt_pageSizes[pageSizeId].widthMillimeters, qt_pageSizes[pageSizeId].heightMillimeters);
0
596 case QPageSize::Point:
never executed: case QPageSize::Point:
0
597 return QSizeF(qt_pageSizes[pageSizeId].widthPoints, qt_pageSizes[pageSizeId].heightPoints);
never executed: return QSizeF(qt_pageSizes[pageSizeId].widthPoints, qt_pageSizes[pageSizeId].heightPoints);
0
598 case QPageSize::Inch:
never executed: case QPageSize::Inch:
0
599 return QSizeF(qt_pageSizes[pageSizeId].widthInches, qt_pageSizes[pageSizeId].heightInches);
never executed: return QSizeF(qt_pageSizes[pageSizeId].widthInches, qt_pageSizes[pageSizeId].heightInches);
0
600 case QPageSize::Pica:
never executed: case QPageSize::Pica:
0
601 case QPageSize::Didot:
never executed: case QPageSize::Didot:
0
602 case QPageSize::Cicero:
never executed: case QPageSize::Cicero:
0
603 return qt_convertPointsToUnits(QSize(qt_pageSizes[pageSizeId].widthPoints,
never executed: return qt_convertPointsToUnits(QSize(qt_pageSizes[pageSizeId].widthPoints, qt_pageSizes[pageSizeId].heightPoints), units);
0
604 qt_pageSizes[pageSizeId].heightPoints), units);
never executed: return qt_convertPointsToUnits(QSize(qt_pageSizes[pageSizeId].widthPoints, qt_pageSizes[pageSizeId].heightPoints), units);
0
605 }-
606 return QSizeF();
never executed: return QSizeF();
0
607}-
608-
609// Find matching standard page size for point size-
610static QPageSize::PageSizeId qt_idForPointSize(const QSize &size, QPageSize::SizeMatchPolicy matchPolicy, QSize *match)-
611{-
612 if (!size.isValid())
!size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
613 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
614-
615 // Try exact match in portrait layout-
616 for (int i = 0; i <= int(QPageSize::LastPageSize); ++i) {
i <= int(QPage...:LastPageSize)Description
TRUEnever evaluated
FALSEnever evaluated
0
617 if (size.width() == qt_pageSizes[i].widthPoints && size.height() == qt_pageSizes[i].heightPoints) {
size.width() =...i].widthPointsDescription
TRUEnever evaluated
FALSEnever evaluated
size.height() ...].heightPointsDescription
TRUEnever evaluated
FALSEnever evaluated
0
618 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
619 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
620 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
621 }-
622 }
never executed: end of block
0
623-
624 // If no exact match only try fuzzy if asked-
625 if (matchPolicy != QPageSize::ExactMatch) {
matchPolicy !=...ze::ExactMatchDescription
TRUEnever evaluated
FALSEnever evaluated
0
626 // Set up the fuzzy tolerance-
627 // TODO Use ISO standard tolerance based on page size?-
628 const int tolerance = 3; // = approx 1mm-
629 const int minWidth = size.width() - tolerance;-
630 const int maxWidth = size.width() + tolerance;-
631 const int minHeight = size.height() - tolerance;-
632 const int maxHeight = size.height() + tolerance;-
633-
634 // First try fuzzy match in portrait layout-
635 for (int i = 0; i <= QPageSize::LastPageSize; ++i) {
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
636 const int width = qt_pageSizes[i].widthPoints;-
637 const int height = qt_pageSizes[i].heightPoints;-
638 if (width >= minWidth && width <= maxWidth && height >= minHeight && height <= maxHeight) {
width >= minWidthDescription
TRUEnever evaluated
FALSEnever evaluated
width <= maxWidthDescription
TRUEnever evaluated
FALSEnever evaluated
height >= minHeightDescription
TRUEnever evaluated
FALSEnever evaluated
height <= maxHeightDescription
TRUEnever evaluated
FALSEnever evaluated
0
639 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
640 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
641 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
642 }-
643 }
never executed: end of block
0
644-
645 // If FuzzyOrientationMatch then try rotated sizes-
646 if (matchPolicy == QPageSize::FuzzyOrientationMatch) {
matchPolicy ==...ientationMatchDescription
TRUEnever evaluated
FALSEnever evaluated
0
647 // First try exact match in landscape layout-
648 for (int i = 0; i <= QPageSize::LastPageSize; ++i) {
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
649 if (size.width() == qt_pageSizes[i].heightPoints && size.height() == qt_pageSizes[i].widthPoints) {
size.width() =...].heightPointsDescription
TRUEnever evaluated
FALSEnever evaluated
size.height() ...i].widthPointsDescription
TRUEnever evaluated
FALSEnever evaluated
0
650 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
651 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
652 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
653 }-
654 }
never executed: end of block
0
655-
656 // Then try fuzzy match in landscape layout-
657 for (int i = 0; i <= QPageSize::LastPageSize; ++i) {
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
658 const int width = qt_pageSizes[i].heightPoints;-
659 const int height = qt_pageSizes[i].widthPoints;-
660 if (width >= minWidth && width <= maxWidth && height >= minHeight && height <= maxHeight) {
width >= minWidthDescription
TRUEnever evaluated
FALSEnever evaluated
width <= maxWidthDescription
TRUEnever evaluated
FALSEnever evaluated
height >= minHeightDescription
TRUEnever evaluated
FALSEnever evaluated
height <= maxHeightDescription
TRUEnever evaluated
FALSEnever evaluated
0
661 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
662 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
663 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
664 }-
665 }
never executed: end of block
0
666 }
never executed: end of block
0
667 }
never executed: end of block
0
668-
669 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
670 *match = size;
never executed: *match = size;
0
671 // Otherwise no match so Custom-
672 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
673}-
674-
675// Find matching standard page size for point size-
676static QPageSize::PageSizeId qt_idForSize(const QSizeF &size, QPageSize::Unit units,-
677 QPageSize::SizeMatchPolicy matchPolicy, QSize *match)-
678{-
679 if (!size.isValid())
!size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
680 return QPageSize::Custom;
never executed: return QPageSize::Custom;
0
681-
682 // Try exact match if units are the same-
683 if (units == QPageSize::Millimeter) {
units == QPageSize::MillimeterDescription
TRUEnever evaluated
FALSEnever evaluated
0
684 for (int i = 0; i <= QPageSize::LastPageSize; ++i) {
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
685 if (size.width() == qt_pageSizes[i].widthMillimeters && size.height() == qt_pageSizes[i].heightMillimeters) {
size.width() =...dthMillimetersDescription
TRUEnever evaluated
FALSEnever evaluated
size.height() ...ghtMillimetersDescription
TRUEnever evaluated
FALSEnever evaluated
0
686 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
687 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
688 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
689 }-
690 }
never executed: end of block
0
691 } else if (units == QPageSize::Inch) {
never executed: end of block
units == QPageSize::InchDescription
TRUEnever evaluated
FALSEnever evaluated
0
692 for (int i = 0; i <= QPageSize::LastPageSize; ++i) {
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
693 if (size.width() == qt_pageSizes[i].widthInches && size.height() == qt_pageSizes[i].heightInches) {
size.width() =...i].widthInchesDescription
TRUEnever evaluated
FALSEnever evaluated
size.height() ...].heightInchesDescription
TRUEnever evaluated
FALSEnever evaluated
0
694 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
695 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
696 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
697 }-
698 }
never executed: end of block
0
699 } else if (units == QPageSize::Point) {
never executed: end of block
units == QPageSize::PointDescription
TRUEnever evaluated
FALSEnever evaluated
0
700 for (int i = 0; i <= QPageSize::LastPageSize; ++i) {
i <= QPageSize::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
701 if (size.width() == qt_pageSizes[i].widthPoints && size.height() == qt_pageSizes[i].heightPoints) {
size.width() =...i].widthPointsDescription
TRUEnever evaluated
FALSEnever evaluated
size.height() ...].heightPointsDescription
TRUEnever evaluated
FALSEnever evaluated
0
702 if (match)
matchDescription
TRUEnever evaluated
FALSEnever evaluated
0
703 *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
never executed: *match = QSize(qt_pageSizes[i].widthPoints, qt_pageSizes[i].heightPoints);
0
704 return qt_pageSizes[i].id;
never executed: return qt_pageSizes[i].id;
0
705 }-
706 }
never executed: end of block
0
707 }
never executed: end of block
0
708-
709 // If no exact match then convert to points and try match those-
710 QSize points = qt_convertUnitsToPoints(size, units);-
711 return qt_idForPointSize(points, matchPolicy, match);
never executed: return qt_idForPointSize(points, matchPolicy, match);
0
712}-
713-
714class QPageSizePrivate : public QSharedData-
715{-
716public:-
717 QPageSizePrivate();-
718 explicit QPageSizePrivate(QPageSize::PageSizeId pageSizeId);-
719 QPageSizePrivate(const QSize &pointSize,-
720 const QString &name,-
721 QPageSize::SizeMatchPolicy matchPolicy);-
722 QPageSizePrivate(const QSizeF &size, QPageSize::Unit units,-
723 const QString &name,-
724 QPageSize::SizeMatchPolicy matchPolicy);-
725 QPageSizePrivate(const QString &key, const QSize &size, const QString &name);-
726 QPageSizePrivate(int windowsId, const QSize &pointSize, const QString &name);-
727 ~QPageSizePrivate();-
728-
729 bool operator==(const QPageSizePrivate &other) const;-
730 bool isEquivalentTo(const QPageSizePrivate &other) const;-
731-
732 bool isValid() const;-
733-
734 QSizeF size(QPageSize::Unit units) const;-
735 QSize sizePixels(int resolution) const;-
736-
737private:-
738 friend class QPageSize;-
739-
740 void init(QPageSize::PageSizeId id, const QString &name);-
741 void init(const QSize &size, const QString &name);-
742 void init(const QSizeF &size, QPageSize::Unit units, const QString &name);-
743-
744 QString m_key;-
745 QPageSize::PageSizeId m_id;-
746 QSize m_pointSize;-
747 QString m_name;-
748 int m_windowsId;-
749 QSizeF m_size;-
750 QPageSize::Unit m_units;-
751};-
752-
753QPageSizePrivate::QPageSizePrivate()-
754 : m_id(QPageSize::Custom),-
755 m_windowsId(0),-
756 m_units(QPageSize::Point)-
757{-
758}
never executed: end of block
0
759-
760QPageSizePrivate::QPageSizePrivate(QPageSize::PageSizeId pageSizeId)-
761 : m_id(QPageSize::Custom),-
762 m_windowsId(0),-
763 m_units(QPageSize::Point)-
764{-
765 if (pageSizeId >= QPageSize::PageSizeId(0) && pageSizeId <= QPageSize::LastPageSize)
pageSizeId >= ...:PageSizeId(0)Description
TRUEnever evaluated
FALSEnever evaluated
pageSizeId <= ...::LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
766 init(pageSizeId, QString());
never executed: init(pageSizeId, QString());
0
767}
never executed: end of block
0
768-
769QPageSizePrivate::QPageSizePrivate(const QSize &pointSize, const QString &name, QPageSize::SizeMatchPolicy matchPolicy)-
770 : m_id(QPageSize::Custom),-
771 m_windowsId(0),-
772 m_units(QPageSize::Point)-
773{-
774 if (pointSize.isValid()) {
pointSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
775 QPageSize::PageSizeId id = qt_idForPointSize(pointSize, matchPolicy, 0);-
776 id == QPageSize::Custom ? init(pointSize, name) : init(id, name);-
777 }
never executed: end of block
0
778}
never executed: end of block
0
779-
780QPageSizePrivate::QPageSizePrivate(const QSizeF &size, QPageSize::Unit units,-
781 const QString &name, QPageSize::SizeMatchPolicy matchPolicy)-
782 : m_id(QPageSize::Custom),-
783 m_windowsId(0),-
784 m_units(QPageSize::Point)-
785{-
786 if (size.isValid()) {
size.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
787 QPageSize::PageSizeId id = qt_idForSize(size, units, matchPolicy, 0);-
788 id == QPageSize::Custom ? init(size, units, name) : init(id, name);-
789 }
never executed: end of block
0
790}
never executed: end of block
0
791-
792QPageSizePrivate::QPageSizePrivate(const QString &key, const QSize &pointSize, const QString &name)-
793 : m_id(QPageSize::Custom),-
794 m_windowsId(0),-
795 m_units(QPageSize::Point)-
796{-
797 if (!key.isEmpty() && pointSize.isValid()) {
!key.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
pointSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
798 QPageSize::PageSizeId id = qt_idForPpdKey(key, 0);-
799 // If not a known PPD key, check if size is a standard PPD size-
800 if (id == QPageSize::Custom)
id == QPageSize::CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
801 id = qt_idForPointSize(pointSize, QPageSize::FuzzyMatch, 0);
never executed: id = qt_idForPointSize(pointSize, QPageSize::FuzzyMatch, 0);
0
802 id == QPageSize::Custom ? init(pointSize, name) : init(id, name);-
803 m_key = key;-
804 }
never executed: end of block
0
805}
never executed: end of block
0
806-
807QPageSizePrivate::QPageSizePrivate(int windowsId, const QSize &pointSize, const QString &name)-
808 : m_id(QPageSize::Custom),-
809 m_windowsId(0),-
810 m_units(QPageSize::Point)-
811{-
812 if (windowsId > 0 && pointSize.isValid()) {
windowsId > 0Description
TRUEnever evaluated
FALSEnever evaluated
pointSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
813 QPageSize::PageSizeId id = qt_idForWindowsID(windowsId, 0);-
814 // If not a known Windows ID, check if size is a standard PPD size-
815 if (id == QPageSize::Custom)
id == QPageSize::CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
816 id = qt_idForPointSize(pointSize, QPageSize::FuzzyMatch, 0);
never executed: id = qt_idForPointSize(pointSize, QPageSize::FuzzyMatch, 0);
0
817 id == QPageSize::Custom ? init(pointSize, name) : init(id, name);-
818 m_windowsId = windowsId;-
819 }
never executed: end of block
0
820}
never executed: end of block
0
821-
822QPageSizePrivate::~QPageSizePrivate()-
823{-
824}-
825-
826// Init a standard PageSizeId-
827void QPageSizePrivate::init(QPageSize::PageSizeId id, const QString &name)-
828{-
829 m_id = id;-
830 m_size = qt_definitionSize(id);-
831 m_units = qt_pageSizes[id].definitionUnits;-
832 m_key = qt_keyForPageSizeId(id);-
833 m_name = name.isEmpty() ? QPageSize::name(id) : name;
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
834 m_windowsId = qt_pageSizes[id].windowsId;-
835 m_pointSize = QSize(qt_pageSizes[id].widthPoints, qt_pageSizes[id].heightPoints);-
836}
never executed: end of block
0
837-
838// Init a point size-
839void QPageSizePrivate::init(const QSize &size, const QString &name)-
840{-
841 m_id = QPageSize::Custom;-
842 m_size = size;-
843 m_units = QPageSize::Point;-
844 m_key = qt_keyForCustomSize(m_size, m_units);-
845 m_name = name.isEmpty() ? qt_nameForCustomSize(m_size, m_units) : name;
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
846 m_windowsId = 0;-
847 m_pointSize = size;-
848}
never executed: end of block
0
849-
850// Init a unit size-
851void QPageSizePrivate::init(const QSizeF &size, QPageSize::Unit units, const QString &name)-
852{-
853 m_id = QPageSize::Custom;-
854 m_size = size;-
855 m_units = units;-
856 m_key = qt_keyForCustomSize(m_size, m_units);-
857 if (name.isEmpty())
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
858 m_name = qt_nameForCustomSize(m_size, m_units);
never executed: m_name = qt_nameForCustomSize(m_size, m_units);
0
859 else-
860 m_name = name;
never executed: m_name = name;
0
861 m_windowsId = 0;-
862 m_pointSize = qt_convertUnitsToPoints(m_size, m_units);-
863}
never executed: end of block
0
864-
865bool QPageSizePrivate::operator==(const QPageSizePrivate &other) const-
866{-
867 return m_size == other.m_size
never executed: return m_size == other.m_size && m_units == other.m_units && m_key == other.m_key && m_name == other.m_name;
0
868 && m_units == other.m_units
never executed: return m_size == other.m_size && m_units == other.m_units && m_key == other.m_key && m_name == other.m_name;
0
869 && m_key == other.m_key
never executed: return m_size == other.m_size && m_units == other.m_units && m_key == other.m_key && m_name == other.m_name;
0
870 && m_name == other.m_name;
never executed: return m_size == other.m_size && m_units == other.m_units && m_key == other.m_key && m_name == other.m_name;
0
871}-
872-
873bool QPageSizePrivate::isEquivalentTo(const QPageSizePrivate &other) const-
874{-
875 return m_pointSize == other.m_pointSize;
never executed: return m_pointSize == other.m_pointSize;
0
876}-
877-
878bool QPageSizePrivate::isValid() const-
879{-
880 return m_pointSize.isValid() && !m_key.isEmpty() && !m_name.isEmpty();
never executed: return m_pointSize.isValid() && !m_key.isEmpty() && !m_name.isEmpty();
0
881}-
882-
883QSizeF QPageSizePrivate::size(QPageSize::Unit units) const-
884{-
885 // If want units we've stored in, we already have them-
886 if (units == m_units)
units == m_unitsDescription
TRUEnever evaluated
FALSEnever evaluated
0
887 return m_size;
never executed: return m_size;
0
888-
889 // If want points we already have them-
890 if (units == QPageSize::Point)
units == QPageSize::PointDescription
TRUEnever evaluated
FALSEnever evaluated
0
891 return QSizeF(m_pointSize.width(), m_pointSize.height());
never executed: return QSizeF(m_pointSize.width(), m_pointSize.height());
0
892-
893 // If a custom size do a conversion-
894 if (m_id == QPageSize::Custom)
m_id == QPageSize::CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
895 return qt_convertUnits(m_size, m_units, units);
never executed: return qt_convertUnits(m_size, m_units, units);
0
896-
897 // Otherwise use the standard sizes-
898 return qt_unitSize(m_id, units);
never executed: return qt_unitSize(m_id, units);
0
899}-
900-
901QSize QPageSizePrivate::sizePixels(int resolution) const-
902{-
903 return qt_convertPointsToPixels(m_pointSize, resolution);;
never executed: return qt_convertPointsToPixels(m_pointSize, resolution);
0
904}-
905-
906-
907/*!-
908 \class QPageSize-
909 \inmodule QtGui-
910 \since 5.3-
911 \brief The QPageSize class describes the size and name of a defined page size-
912-
913 This class implements support for the set of standard page sizes as defined-
914 in the Adobe Postscript PPD Standard v4.3. It defines the standard set of-
915 page sizes in points, millimeters and inches and ensures these sizes are-
916 consistently used. Other size units can be used but will be calculated-
917 results and so may not always be consistent. The defined point sizes are-
918 always a integer, all other sizes can be fractions of a unit.-
919-
920 The defined size is always in width x height order with no implied page-
921 orientation. Note that it is possible for page sizes to be defined where the-
922 width is greater than the height, such as QPageSize::Ledger, so you cannot-
923 rely on comparing the width and height values to determine page orientation.-
924-
925 For example, A4 is defined by the standard as 210mm x 297mm, 8.27in x 11.69in,-
926 or 595pt x 842pt.-
927-
928 You can also define custom page sizes with custom names in any units you want-
929 and this unit size will be preserved and used as the base for all other unit-
930 size calculations.-
931-
932 When creating a QPageSize using a custom QSize you can choose if you want-
933 QPageSize to try match the size to a standard page size. By default-
934 QPaperSize uses a FuzzyMatch mode where it will match a given page size to-
935 a standard page size if it falls within 3 postscript points of a defined-
936 standard size. You can override this to request only an exact match but this-
937 is not recommended as conversions between units can easily lose 3 points and-
938 result in incorrect page sizes.-
939-
940 A QPageSize instance may also be obtained by querying the supported page sizes-
941 for a print device. In this case the localized name returned is that defined-
942 by the printer itself. Note that the print device may not support the current-
943 default locale language.-
944-
945 The class also provides convenience methods for converting page size IDs to and from-
946 various unit sizes.-
947-
948 \sa QPagedPaintDevice, QPdfWriter-
949*/-
950-
951/*!-
952 \enum QPageSize::PageSizeId-
953-
954 This enum type lists the available page sizes as defined in the Postscript-
955 PPD standard. These values are duplicated in QPagedPaintDevice and QPrinter.-
956-
957 The defined sizes are:-
958-
959 \value A0 841 x 1189 mm-
960 \value A1 594 x 841 mm-
961 \value A2 420 x 594 mm-
962 \value A3 297 x 420 mm-
963 \value A4 210 x 297 mm, 8.26 x 11.69 inches-
964 \value A5 148 x 210 mm-
965 \value A6 105 x 148 mm-
966 \value A7 74 x 105 mm-
967 \value A8 52 x 74 mm-
968 \value A9 37 x 52 mm-
969 \value B0 1000 x 1414 mm-
970 \value B1 707 x 1000 mm-
971 \value B2 500 x 707 mm-
972 \value B3 353 x 500 mm-
973 \value B4 250 x 353 mm-
974 \value B5 176 x 250 mm, 6.93 x 9.84 inches-
975 \value B6 125 x 176 mm-
976 \value B7 88 x 125 mm-
977 \value B8 62 x 88 mm-
978 \value B9 44 x 62 mm-
979 \value B10 31 x 44 mm-
980 \value C5E 163 x 229 mm-
981 \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope-
982 \value DLE 110 x 220 mm-
983 \value Executive 7.5 x 10 inches, 190.5 x 254 mm-
984 \value Folio 210 x 330 mm-
985 \value Ledger 431.8 x 279.4 mm-
986 \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm-
987 \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm-
988 \value Tabloid 279.4 x 431.8 mm-
989 \value Custom Unknown, or a user defined size.-
990 \value A10-
991 \value A3Extra-
992 \value A4Extra-
993 \value A4Plus-
994 \value A4Small-
995 \value A5Extra-
996 \value B5Extra-
997 \value JisB0-
998 \value JisB1-
999 \value JisB2-
1000 \value JisB3-
1001 \value JisB4-
1002 \value JisB5-
1003 \value JisB6,-
1004 \value JisB7-
1005 \value JisB8-
1006 \value JisB9-
1007 \value JisB10-
1008 \value AnsiA = Letter-
1009 \value AnsiB = Ledger-
1010 \value AnsiC-
1011 \value AnsiD-
1012 \value AnsiE-
1013 \value LegalExtra-
1014 \value LetterExtra-
1015 \value LetterPlus-
1016 \value LetterSmall-
1017 \value TabloidExtra-
1018 \value ArchA-
1019 \value ArchB-
1020 \value ArchC-
1021 \value ArchD-
1022 \value ArchE-
1023 \value Imperial7x9-
1024 \value Imperial8x10-
1025 \value Imperial9x11-
1026 \value Imperial9x12-
1027 \value Imperial10x11-
1028 \value Imperial10x13-
1029 \value Imperial10x14-
1030 \value Imperial12x11-
1031 \value Imperial15x11-
1032 \value ExecutiveStandard-
1033 \value Note-
1034 \value Quarto-
1035 \value Statement-
1036 \value SuperA-
1037 \value SuperB-
1038 \value Postcard-
1039 \value DoublePostcard-
1040 \value Prc16K-
1041 \value Prc32K-
1042 \value Prc32KBig-
1043 \value FanFoldUS-
1044 \value FanFoldGerman-
1045 \value FanFoldGermanLegal-
1046 \value EnvelopeB4-
1047 \value EnvelopeB5-
1048 \value EnvelopeB6-
1049 \value EnvelopeC0-
1050 \value EnvelopeC1-
1051 \value EnvelopeC2-
1052 \value EnvelopeC3-
1053 \value EnvelopeC4-
1054 \value EnvelopeC5 = C5E-
1055 \value EnvelopeC6-
1056 \value EnvelopeC65-
1057 \value EnvelopeC7-
1058 \value EnvelopeDL = DLE-
1059 \value Envelope9-
1060 \value Envelope10 = Comm10E-
1061 \value Envelope11-
1062 \value Envelope12-
1063 \value Envelope14-
1064 \value EnvelopeMonarch-
1065 \value EnvelopePersonal-
1066 \value EnvelopeChou3-
1067 \value EnvelopeChou4-
1068 \value EnvelopeInvite-
1069 \value EnvelopeItalian-
1070 \value EnvelopeKaku2-
1071 \value EnvelopeKaku3-
1072 \value EnvelopePrc1-
1073 \value EnvelopePrc2-
1074 \value EnvelopePrc3-
1075 \value EnvelopePrc4-
1076 \value EnvelopePrc5-
1077 \value EnvelopePrc6-
1078 \value EnvelopePrc7-
1079 \value EnvelopePrc8-
1080 \value EnvelopePrc9-
1081 \value EnvelopePrc10-
1082 \value EnvelopeYou4-
1083 \value LastPageSize = EnvelopeYou4-
1084 \omitvalue NPageSize-
1085 \omitvalue NPaperSize-
1086-
1087 Due to historic reasons QPageSize::Executive is not the same as the standard-
1088 Postscript and Windows Executive size, use QPageSize::ExecutiveStandard instead.-
1089-
1090 The Postscript standard size QPageSize::Folio is different to the Windows-
1091 DMPAPER_FOLIO size, use the Postscript standard size QPageSize::FanFoldGermanLegal-
1092 if needed.-
1093*/-
1094-
1095/*!-
1096 \enum QPageSize::Unit-
1097-
1098 This enum type is used to specify the measurement unit for page sizes.-
1099-
1100 \value Millimeter-
1101 \value Point 1/72th of an inch-
1102 \value Inch-
1103 \value Pica 1/72th of a foot, 1/6th of an inch, 12 Points-
1104 \value Didot 1/72th of a French inch, 0.375 mm-
1105 \value Cicero 1/6th of a French inch, 12 Didot, 4.5mm-
1106*/-
1107-
1108/*!-
1109 \enum QPageSize::SizeMatchPolicy-
1110-
1111 \value FuzzyMatch Match to a standard page size if within the margin of tolerance.-
1112 \value FuzzyOrientationMatch Match to a standard page size if within the margin of tolerance regardless of orientation.-
1113 \value ExactMatch Only match to a standard page size if the sizes match exactly.-
1114*/-
1115-
1116/*!-
1117 Creates a null QPageSize.-
1118*/-
1119-
1120QPageSize::QPageSize()-
1121 : d(new QPageSizePrivate())-
1122{-
1123}
never executed: end of block
0
1124-
1125/*!-
1126 Creates a QPageSize of the standard \a pageSize.-
1127-
1128 If \a pageSize is QPageSize::Custom then the resulting QPageSize will not-
1129 be valid. Use the custom size constructor instead.-
1130*/-
1131-
1132QPageSize::QPageSize(PageSizeId pageSize)-
1133 : d(new QPageSizePrivate(pageSize))-
1134{-
1135}
never executed: end of block
0
1136-
1137/*!-
1138 Creates a QPageSize of the given \a pointSize in Points using the matching \a matchPolicy.-
1139-
1140 If the given \a pointSize matches a standard QPageSize::PageSizeId, then that page-
1141 size will be used. Note that if the \a matchPolicy is FuzzyMatch this may result-
1142 in the \a pointSize being adjusted to the standard size. To prevent this happening-
1143 use a \a matchPolicy of ExactMatch instead.-
1144-
1145 If the given \a pointSize is not a standard QPageSize::PageSizeId then a QPageSize::Custom-
1146 size will be created.-
1147-
1148 If \a name is null then the standard localized name will be used. If a custom page-
1149 size then a custom name in the format "Custom (width x height)" will be created.-
1150-
1151 The \a matchPolicy defaults to FuzzyMatch.-
1152*/-
1153-
1154QPageSize::QPageSize(const QSize &pointSize, const QString &name, SizeMatchPolicy matchPolicy)-
1155 : d(new QPageSizePrivate(pointSize, name, matchPolicy))-
1156{-
1157}
never executed: end of block
0
1158-
1159/*!-
1160 Creates a custom page of the given \a size in \a units.-
1161-
1162 If the given \a size matches a standard QPageSize::PageSizeId, then that page-
1163 size will be used. Note that if the \a matchPolicy is FuzzyMatch this may result-
1164 in the \a size being adjusted to the standard size. To prevent this happening-
1165 use a \a matchPolicy of ExactMatch instead.-
1166-
1167 If the given \a size is not a standard QPageSize::PageSizeId then a QPageSize::Custom-
1168 size will be created. The original unit size will be preserved and used as the-
1169 base for all other unit size calculations.-
1170-
1171 If \a name is null then a custom name will be created in the form-
1172 "Custom (width x height)" where the size is expressed in units provided.-
1173*/-
1174-
1175QPageSize::QPageSize(const QSizeF &size, Unit units,-
1176 const QString &name, SizeMatchPolicy matchPolicy)-
1177 : d(new QPageSizePrivate(size, units, name, matchPolicy))-
1178{-
1179}
never executed: end of block
0
1180-
1181/*!-
1182 \internal-
1183-
1184 Create page with given key, size and name, for use by printer plugin.-
1185*/-
1186-
1187QPageSize::QPageSize(const QString &key, const QSize &pointSize, const QString &name)-
1188 : d(new QPageSizePrivate(key, pointSize, name))-
1189{-
1190}
never executed: end of block
0
1191-
1192/*!-
1193 \internal-
1194-
1195 Create page with given windows ID, size and name, for use by printer plugin.-
1196*/-
1197-
1198QPageSize::QPageSize(int windowsId, const QSize &pointSize, const QString &name)-
1199 : d(new QPageSizePrivate(windowsId, pointSize, name))-
1200{-
1201}
never executed: end of block
0
1202-
1203/*!-
1204 \internal-
1205-
1206 Create page with given private backend-
1207*/-
1208-
1209QPageSize::QPageSize(QPageSizePrivate &dd)-
1210 : d(&dd)-
1211{-
1212}
never executed: end of block
0
1213-
1214/*!-
1215 Copy constructor, copies \a other to this.-
1216*/-
1217-
1218QPageSize::QPageSize(const QPageSize &other)-
1219 : d(other.d)-
1220{-
1221}
never executed: end of block
0
1222-
1223/*!-
1224 Destroys the page.-
1225*/-
1226-
1227QPageSize::~QPageSize()-
1228{-
1229}-
1230-
1231/*!-
1232 Assignment operator, assigns \a other to this.-
1233*/-
1234-
1235QPageSize &QPageSize::operator=(const QPageSize &other)-
1236{-
1237 d = other.d;-
1238 return *this;
never executed: return *this;
0
1239}-
1240-
1241/*!-
1242 \fn void QPageSize::swap(QPageSize &other)-
1243-
1244 Swaps this QPageSize with \a other. This function is very fast and-
1245 never fails.-
1246*/-
1247-
1248/*!-
1249 \fn QPageSize &QPageSize::operator=(QPageSize &&other)-
1250-
1251 Move-assigns \a other to this QPageSize instance, transferring the-
1252 ownership of the managed pointer to this instance.-
1253*/-
1254-
1255/*!-
1256 \relates QPageSize-
1257-
1258 Returns \c true if page size \a lhs is equal to page size \a rhs,-
1259 i.e. if the page sizes have the same attributes. Current-
1260 attributes are size and name.-
1261*/-
1262-
1263bool operator==(const QPageSize &lhs, const QPageSize &rhs)-
1264{-
1265 return lhs.d == rhs.d || *lhs.d == *rhs.d;
never executed: return lhs.d == rhs.d || *lhs.d == *rhs.d;
0
1266}-
1267/*!-
1268 \fn bool operator!=(const QPageSize &lhs, const QPageSize &rhs)-
1269 \relates QPageSize-
1270-
1271 Returns \c true if page size \a lhs is unequal to page size \a-
1272 rhs, i.e. if the page size has different attributes. Current-
1273 attributes are size and name.-
1274*/-
1275-
1276/*!-
1277 Returns \c true if this page is equivalent to the \a other page, i.e. if the-
1278 page has the same size regardless of other attributes like name.-
1279*/-
1280-
1281bool QPageSize::isEquivalentTo(const QPageSize &other) const-
1282{-
1283 if (d == other.d)
d == other.dDescription
TRUEnever evaluated
FALSEnever evaluated
0
1284 return true;
never executed: return true;
0
1285 return d && other.d && d->isEquivalentTo(*other.d);
never executed: return d && other.d && d->isEquivalentTo(*other.d);
0
1286}-
1287-
1288/*!-
1289 Returns \c true if this page size is valid.-
1290-
1291 The page size may be invalid if created with an invalid PageSizeId, or a-
1292 negative or invalid QSize or QSizeF, or the null constructor.-
1293*/-
1294-
1295bool QPageSize::isValid() const-
1296{-
1297 return d && d->isValid();
never executed: return d && d->isValid();
0
1298}-
1299-
1300/*!-
1301 Returns the unique key of the page size.-
1302-
1303 By default this is the PPD standard mediaOption keyword for the page size,-
1304 or the PPD custom format key. If the QPageSize instance was obtained from-
1305 a print device then this will be the key provided by the print device and-
1306 may differ from the standard key.-
1307-
1308 If the QPageSize is invalid then the key will be an empty string.-
1309-
1310 This key should never be shown to end users, it is an internal key only.-
1311 For a human-readable name use name().-
1312-
1313 \sa name()-
1314*/-
1315-
1316QString QPageSize::key() const-
1317{-
1318 return isValid() ? d->m_key : QString();
never executed: return isValid() ? d->m_key : QString();
0
1319}-
1320-
1321/*!-
1322 Returns a localized human-readable name for the page size.-
1323-
1324 If the QPageSize instance was obtained from a print device then the name-
1325 used is that provided by the print device. Note that a print device may-
1326 not support the current default locale language.-
1327-
1328 If the QPageSize is invalid then the name will be an empty string.-
1329*/-
1330-
1331QString QPageSize::name() const-
1332{-
1333 return isValid() ? d->m_name : QString();
never executed: return isValid() ? d->m_name : QString();
0
1334}-
1335-
1336/*!-
1337 Returns the standard QPageSize::PageSizeId of the page, or QPageSize::Custom.-
1338-
1339 If the QPageSize is invalid then the ID will be QPageSize::Custom.-
1340*/-
1341-
1342QPageSize::PageSizeId QPageSize::id() const-
1343{-
1344 return isValid() ? d->m_id : Custom;
never executed: return isValid() ? d->m_id : Custom;
0
1345}-
1346-
1347/*!-
1348 Returns the Windows DMPAPER enum value for the page size.-
1349-
1350 Not all valid PPD page sizes have a Windows equivalent, in which case 0-
1351 will be returned.-
1352-
1353 If the QPageSize is invalid then the Windows ID will be 0.-
1354-
1355 \sa id()-
1356*/-
1357-
1358int QPageSize::windowsId() const-
1359{-
1360 if (!isValid())
!isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1361 return 0;
never executed: return 0;
0
1362 return d->m_windowsId > 0 ? d->m_windowsId : windowsId(d->m_id);
never executed: return d->m_windowsId > 0 ? d->m_windowsId : windowsId(d->m_id);
0
1363}-
1364-
1365/*!-
1366 Returns the definition size of the page size.-
1367-
1368 For a standard page size this will be the size as defined in the relevant-
1369 standard, i.e. ISO A4 will be defined in millimeters while ANSI Letter will-
1370 be defined in inches.-
1371-
1372 For a custom page size this will be the original size used to create the-
1373 page size object.-
1374-
1375 If the QPageSize is invalid then the QSizeF will be invalid.-
1376-
1377 \sa definitionUnits()-
1378*/-
1379-
1380QSizeF QPageSize::definitionSize() const-
1381{-
1382 return isValid() ? d->m_size : QSizeF();
never executed: return isValid() ? d->m_size : QSizeF();
0
1383}-
1384-
1385/*!-
1386 Returns the definition units of the page size.-
1387-
1388 For a standard page size this will be the units as defined in the relevant-
1389 standard, i.e. ISO A4 will be defined in millimeters while ANSI Letter will-
1390 be defined in inches.-
1391-
1392 For a custom page size this will be the original units used to create the-
1393 page size object.-
1394-
1395 If the QPageSize is invalid then the QPageSize::Unit will be invalid.-
1396-
1397 \sa definitionSize()-
1398*/-
1399-
1400QPageSize::Unit QPageSize::definitionUnits() const-
1401{-
1402 return isValid() ? d->m_units : Unit(-1);
never executed: return isValid() ? d->m_units : Unit(-1);
0
1403}-
1404-
1405/*!-
1406 Returns the size of the page in the required \a units.-
1407-
1408 If the QPageSize is invalid then the QSizeF will be invalid.-
1409*/-
1410-
1411QSizeF QPageSize::size(Unit units) const-
1412{-
1413 return isValid() ? d->size(units) : QSize();
never executed: return isValid() ? d->size(units) : QSize();
0
1414}-
1415-
1416/*!-
1417 Returns the size of the page in Postscript Points (1/72 of an inch).-
1418-
1419 If the QPageSize is invalid then the QSize will be invalid.-
1420*/-
1421-
1422QSize QPageSize::sizePoints() const-
1423{-
1424 return isValid() ? d->m_pointSize : QSize();
never executed: return isValid() ? d->m_pointSize : QSize();
0
1425}-
1426-
1427/*!-
1428 Returns the size of the page in Device Pixels at the given \a resolution.-
1429-
1430 If the QPageSize is invalid then the QSize will be invalid.-
1431*/-
1432-
1433QSize QPageSize::sizePixels(int resolution) const-
1434{-
1435 return isValid() ? d->sizePixels(resolution) : QSize();
never executed: return isValid() ? d->sizePixels(resolution) : QSize();
0
1436}-
1437-
1438/*!-
1439 Returns the page rectangle in the required \a units.-
1440-
1441 If the QPageSize is invalid then the QRect will be invalid.-
1442*/-
1443-
1444QRectF QPageSize::rect(Unit units) const-
1445{-
1446 return isValid() ? QRectF(QPointF(0, 0), d->size(units)) : QRectF();
never executed: return isValid() ? QRectF(QPointF(0, 0), d->size(units)) : QRectF();
0
1447}-
1448-
1449/*!-
1450 Returns the page rectangle in Postscript Points (1/72 of an inch).-
1451-
1452 If the QPageSize is invalid then the QRect will be invalid.-
1453*/-
1454-
1455QRect QPageSize::rectPoints() const-
1456{-
1457 return isValid() ? QRect(QPoint(0, 0), d->m_pointSize) : QRect();
never executed: return isValid() ? QRect(QPoint(0, 0), d->m_pointSize) : QRect();
0
1458}-
1459-
1460/*!-
1461 Returns the page rectangle in Device Pixels at the given \a resolution.-
1462-
1463 If the QPageSize is invalid then the QRect will be invalid.-
1464*/-
1465-
1466QRect QPageSize::rectPixels(int resolution) const-
1467{-
1468 return isValid() ? QRect(QPoint(0, 0), d->sizePixels(resolution)) : QRect();
never executed: return isValid() ? QRect(QPoint(0, 0), d->sizePixels(resolution)) : QRect();
0
1469}-
1470-
1471// Statics-
1472-
1473/*!-
1474 Returns the PPD mediaOption keyword of the standard \a pageSizeId.-
1475-
1476 If the QPageSize is invalid then the key will be empty.-
1477*/-
1478-
1479QString QPageSize::key(PageSizeId pageSizeId)-
1480{-
1481 if (pageSizeId < PageSizeId(0) || pageSizeId > LastPageSize)
pageSizeId < PageSizeId(0)Description
TRUEnever evaluated
FALSEnever evaluated
pageSizeId > LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1482 return QString();
never executed: return QString();
0
1483 return QString::fromUtf8(qt_pageSizes[pageSizeId].mediaOption);
never executed: return QString::fromUtf8(qt_pageSizes[pageSizeId].mediaOption);
0
1484}-
1485-
1486static QString msgImperialPageSizeInch(int width, int height)-
1487{-
1488 //: Page size in 'Inch'.-
1489 return QCoreApplication::translate("QPageSize", "%1 x %2 in").arg(width).arg(height);
never executed: return QCoreApplication::translate("QPageSize", "%1 x %2 in").arg(width).arg(height);
0
1490}-
1491-
1492/*!-
1493 Returns the localized name of the standard \a pageSizeId.-
1494-
1495 If the QPageSize is invalid then the name will be empty.-
1496*/-
1497-
1498QString QPageSize::name(PageSizeId pageSizeId)-
1499{-
1500 if (pageSizeId < PageSizeId(0) || pageSizeId > LastPageSize)
pageSizeId < PageSizeId(0)Description
TRUEnever evaluated
FALSEnever evaluated
pageSizeId > LastPageSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1501 return QString();
never executed: return QString();
0
1502-
1503 switch (pageSizeId) {-
1504 case A0:
never executed: case A0:
0
1505 return QCoreApplication::translate("QPageSize", "A0");
never executed: return QCoreApplication::translate("QPageSize", "A0");
0
1506 case A1:
never executed: case A1:
0
1507 return QCoreApplication::translate("QPageSize", "A1");
never executed: return QCoreApplication::translate("QPageSize", "A1");
0
1508 case A2:
never executed: case A2:
0
1509 return QCoreApplication::translate("QPageSize", "A2");
never executed: return QCoreApplication::translate("QPageSize", "A2");
0
1510 case A3:
never executed: case A3:
0
1511 return QCoreApplication::translate("QPageSize", "A3");
never executed: return QCoreApplication::translate("QPageSize", "A3");
0
1512 case A4:
never executed: case A4:
0
1513 return QCoreApplication::translate("QPageSize", "A4");
never executed: return QCoreApplication::translate("QPageSize", "A4");
0
1514 case A5:
never executed: case A5:
0
1515 return QCoreApplication::translate("QPageSize", "A5");
never executed: return QCoreApplication::translate("QPageSize", "A5");
0
1516 case A6:
never executed: case A6:
0
1517 return QCoreApplication::translate("QPageSize", "A6");
never executed: return QCoreApplication::translate("QPageSize", "A6");
0
1518 case A7:
never executed: case A7:
0
1519 return QCoreApplication::translate("QPageSize", "A7");
never executed: return QCoreApplication::translate("QPageSize", "A7");
0
1520 case A8:
never executed: case A8:
0
1521 return QCoreApplication::translate("QPageSize", "A8");
never executed: return QCoreApplication::translate("QPageSize", "A8");
0
1522 case A9:
never executed: case A9:
0
1523 return QCoreApplication::translate("QPageSize", "A9");
never executed: return QCoreApplication::translate("QPageSize", "A9");
0
1524 case A10:
never executed: case A10:
0
1525 return QCoreApplication::translate("QPageSize", "A10");
never executed: return QCoreApplication::translate("QPageSize", "A10");
0
1526 case B0:
never executed: case B0:
0
1527 return QCoreApplication::translate("QPageSize", "B0");
never executed: return QCoreApplication::translate("QPageSize", "B0");
0
1528 case B1:
never executed: case B1:
0
1529 return QCoreApplication::translate("QPageSize", "B1");
never executed: return QCoreApplication::translate("QPageSize", "B1");
0
1530 case B2:
never executed: case B2:
0
1531 return QCoreApplication::translate("QPageSize", "B2");
never executed: return QCoreApplication::translate("QPageSize", "B2");
0
1532 case B3:
never executed: case B3:
0
1533 return QCoreApplication::translate("QPageSize", "B3");
never executed: return QCoreApplication::translate("QPageSize", "B3");
0
1534 case B4:
never executed: case B4:
0
1535 return QCoreApplication::translate("QPageSize", "B4");
never executed: return QCoreApplication::translate("QPageSize", "B4");
0
1536 case B5:
never executed: case B5:
0
1537 return QCoreApplication::translate("QPageSize", "B5");
never executed: return QCoreApplication::translate("QPageSize", "B5");
0
1538 case B6:
never executed: case B6:
0
1539 return QCoreApplication::translate("QPageSize", "B6");
never executed: return QCoreApplication::translate("QPageSize", "B6");
0
1540 case B7:
never executed: case B7:
0
1541 return QCoreApplication::translate("QPageSize", "B7");
never executed: return QCoreApplication::translate("QPageSize", "B7");
0
1542 case B8:
never executed: case B8:
0
1543 return QCoreApplication::translate("QPageSize", "B8");
never executed: return QCoreApplication::translate("QPageSize", "B8");
0
1544 case B9:
never executed: case B9:
0
1545 return QCoreApplication::translate("QPageSize", "B9");
never executed: return QCoreApplication::translate("QPageSize", "B9");
0
1546 case B10:
never executed: case B10:
0
1547 return QCoreApplication::translate("QPageSize", "B10");
never executed: return QCoreApplication::translate("QPageSize", "B10");
0
1548 case Executive:
never executed: case Executive:
0
1549 return QCoreApplication::translate("QPageSize", "Executive (7.5 x 10 in)");
never executed: return QCoreApplication::translate("QPageSize", "Executive (7.5 x 10 in)");
0
1550 case ExecutiveStandard:
never executed: case ExecutiveStandard:
0
1551 return QCoreApplication::translate("QPageSize", "Executive (7.25 x 10.5 in)");
never executed: return QCoreApplication::translate("QPageSize", "Executive (7.25 x 10.5 in)");
0
1552 case Folio:
never executed: case Folio:
0
1553 return QCoreApplication::translate("QPageSize", "Folio (8.27 x 13 in)");
never executed: return QCoreApplication::translate("QPageSize", "Folio (8.27 x 13 in)");
0
1554 case Legal:
never executed: case Legal:
0
1555 return QCoreApplication::translate("QPageSize", "Legal");
never executed: return QCoreApplication::translate("QPageSize", "Legal");
0
1556 case Letter:
never executed: case Letter:
0
1557 return QCoreApplication::translate("QPageSize", "Letter / ANSI A");
never executed: return QCoreApplication::translate("QPageSize", "Letter / ANSI A");
0
1558 case Tabloid:
never executed: case Tabloid:
0
1559 return QCoreApplication::translate("QPageSize", "Tabloid / ANSI B");
never executed: return QCoreApplication::translate("QPageSize", "Tabloid / ANSI B");
0
1560 case Ledger:
never executed: case Ledger:
0
1561 return QCoreApplication::translate("QPageSize", "Ledger / ANSI B");
never executed: return QCoreApplication::translate("QPageSize", "Ledger / ANSI B");
0
1562 case Custom:
never executed: case Custom:
0
1563 return QCoreApplication::translate("QPageSize", "Custom");
never executed: return QCoreApplication::translate("QPageSize", "Custom");
0
1564 case A3Extra:
never executed: case A3Extra:
0
1565 return QCoreApplication::translate("QPageSize", "A3 Extra");
never executed: return QCoreApplication::translate("QPageSize", "A3 Extra");
0
1566 case A4Extra:
never executed: case A4Extra:
0
1567 return QCoreApplication::translate("QPageSize", "A4 Extra");
never executed: return QCoreApplication::translate("QPageSize", "A4 Extra");
0
1568 case A4Plus:
never executed: case A4Plus:
0
1569 return QCoreApplication::translate("QPageSize", "A4 Plus");
never executed: return QCoreApplication::translate("QPageSize", "A4 Plus");
0
1570 case A4Small:
never executed: case A4Small:
0
1571 return QCoreApplication::translate("QPageSize", "A4 Small");
never executed: return QCoreApplication::translate("QPageSize", "A4 Small");
0
1572 case A5Extra:
never executed: case A5Extra:
0
1573 return QCoreApplication::translate("QPageSize", "A5 Extra");
never executed: return QCoreApplication::translate("QPageSize", "A5 Extra");
0
1574 case B5Extra:
never executed: case B5Extra:
0
1575 return QCoreApplication::translate("QPageSize", "B5 Extra");
never executed: return QCoreApplication::translate("QPageSize", "B5 Extra");
0
1576 case JisB0:
never executed: case JisB0:
0
1577 return QCoreApplication::translate("QPageSize", "JIS B0");
never executed: return QCoreApplication::translate("QPageSize", "JIS B0");
0
1578 case JisB1:
never executed: case JisB1:
0
1579 return QCoreApplication::translate("QPageSize", "JIS B1");
never executed: return QCoreApplication::translate("QPageSize", "JIS B1");
0
1580 case JisB2:
never executed: case JisB2:
0
1581 return QCoreApplication::translate("QPageSize", "JIS B2");
never executed: return QCoreApplication::translate("QPageSize", "JIS B2");
0
1582 case JisB3:
never executed: case JisB3:
0
1583 return QCoreApplication::translate("QPageSize", "JIS B3");
never executed: return QCoreApplication::translate("QPageSize", "JIS B3");
0
1584 case JisB4:
never executed: case JisB4:
0
1585 return QCoreApplication::translate("QPageSize", "JIS B4");
never executed: return QCoreApplication::translate("QPageSize", "JIS B4");
0
1586 case JisB5:
never executed: case JisB5:
0
1587 return QCoreApplication::translate("QPageSize", "JIS B5");
never executed: return QCoreApplication::translate("QPageSize", "JIS B5");
0
1588 case JisB6:
never executed: case JisB6:
0
1589 return QCoreApplication::translate("QPageSize", "JIS B6");
never executed: return QCoreApplication::translate("QPageSize", "JIS B6");
0
1590 case JisB7:
never executed: case JisB7:
0
1591 return QCoreApplication::translate("QPageSize", "JIS B7");
never executed: return QCoreApplication::translate("QPageSize", "JIS B7");
0
1592 case JisB8:
never executed: case JisB8:
0
1593 return QCoreApplication::translate("QPageSize", "JIS B8");
never executed: return QCoreApplication::translate("QPageSize", "JIS B8");
0
1594 case JisB9:
never executed: case JisB9:
0
1595 return QCoreApplication::translate("QPageSize", "JIS B9");
never executed: return QCoreApplication::translate("QPageSize", "JIS B9");
0
1596 case JisB10:
never executed: case JisB10:
0
1597 return QCoreApplication::translate("QPageSize", "JIS B10");
never executed: return QCoreApplication::translate("QPageSize", "JIS B10");
0
1598 case AnsiC:
never executed: case AnsiC:
0
1599 return QCoreApplication::translate("QPageSize", "ANSI C");
never executed: return QCoreApplication::translate("QPageSize", "ANSI C");
0
1600 case AnsiD:
never executed: case AnsiD:
0
1601 return QCoreApplication::translate("QPageSize", "ANSI D");
never executed: return QCoreApplication::translate("QPageSize", "ANSI D");
0
1602 case AnsiE:
never executed: case AnsiE:
0
1603 return QCoreApplication::translate("QPageSize", "ANSI E");
never executed: return QCoreApplication::translate("QPageSize", "ANSI E");
0
1604 case LegalExtra:
never executed: case LegalExtra:
0
1605 return QCoreApplication::translate("QPageSize", "Legal Extra");
never executed: return QCoreApplication::translate("QPageSize", "Legal Extra");
0
1606 case LetterExtra:
never executed: case LetterExtra:
0
1607 return QCoreApplication::translate("QPageSize", "Letter Extra");
never executed: return QCoreApplication::translate("QPageSize", "Letter Extra");
0
1608 case LetterPlus:
never executed: case LetterPlus:
0
1609 return QCoreApplication::translate("QPageSize", "Letter Plus");
never executed: return QCoreApplication::translate("QPageSize", "Letter Plus");
0
1610 case LetterSmall:
never executed: case LetterSmall:
0
1611 return QCoreApplication::translate("QPageSize", "Letter Small");
never executed: return QCoreApplication::translate("QPageSize", "Letter Small");
0
1612 case TabloidExtra:
never executed: case TabloidExtra:
0
1613 return QCoreApplication::translate("QPageSize", "Tabloid Extra");
never executed: return QCoreApplication::translate("QPageSize", "Tabloid Extra");
0
1614 case ArchA:
never executed: case ArchA:
0
1615 return QCoreApplication::translate("QPageSize", "Architect A");
never executed: return QCoreApplication::translate("QPageSize", "Architect A");
0
1616 case ArchB:
never executed: case ArchB:
0
1617 return QCoreApplication::translate("QPageSize", "Architect B");
never executed: return QCoreApplication::translate("QPageSize", "Architect B");
0
1618 case ArchC:
never executed: case ArchC:
0
1619 return QCoreApplication::translate("QPageSize", "Architect C");
never executed: return QCoreApplication::translate("QPageSize", "Architect C");
0
1620 case ArchD:
never executed: case ArchD:
0
1621 return QCoreApplication::translate("QPageSize", "Architect D");
never executed: return QCoreApplication::translate("QPageSize", "Architect D");
0
1622 case ArchE:
never executed: case ArchE:
0
1623 return QCoreApplication::translate("QPageSize", "Architect E");
never executed: return QCoreApplication::translate("QPageSize", "Architect E");
0
1624 case Imperial7x9:
never executed: case Imperial7x9:
0
1625 return msgImperialPageSizeInch(7, 9);
never executed: return msgImperialPageSizeInch(7, 9);
0
1626 case Imperial8x10:
never executed: case Imperial8x10:
0
1627 return msgImperialPageSizeInch(8, 10);
never executed: return msgImperialPageSizeInch(8, 10);
0
1628 case Imperial9x11:
never executed: case Imperial9x11:
0
1629 return msgImperialPageSizeInch(9, 11);
never executed: return msgImperialPageSizeInch(9, 11);
0
1630 case Imperial9x12:
never executed: case Imperial9x12:
0
1631 return msgImperialPageSizeInch(9, 12);
never executed: return msgImperialPageSizeInch(9, 12);
0
1632 case Imperial10x11:
never executed: case Imperial10x11:
0
1633 return msgImperialPageSizeInch(10, 11);
never executed: return msgImperialPageSizeInch(10, 11);
0
1634 case Imperial10x13:
never executed: case Imperial10x13:
0
1635 return msgImperialPageSizeInch(10, 13);
never executed: return msgImperialPageSizeInch(10, 13);
0
1636 case Imperial10x14:
never executed: case Imperial10x14:
0
1637 return msgImperialPageSizeInch(10, 14);
never executed: return msgImperialPageSizeInch(10, 14);
0
1638 case Imperial12x11:
never executed: case Imperial12x11:
0
1639 return msgImperialPageSizeInch(12, 11);
never executed: return msgImperialPageSizeInch(12, 11);
0
1640 case Imperial15x11:
never executed: case Imperial15x11:
0
1641 return msgImperialPageSizeInch(15, 11);
never executed: return msgImperialPageSizeInch(15, 11);
0
1642 case Note:
never executed: case Note:
0
1643 return QCoreApplication::translate("QPageSize", "Note");
never executed: return QCoreApplication::translate("QPageSize", "Note");
0
1644 case Quarto:
never executed: case Quarto:
0
1645 return QCoreApplication::translate("QPageSize", "Quarto");
never executed: return QCoreApplication::translate("QPageSize", "Quarto");
0
1646 case Statement:
never executed: case Statement:
0
1647 return QCoreApplication::translate("QPageSize", "Statement");
never executed: return QCoreApplication::translate("QPageSize", "Statement");
0
1648 case SuperA:
never executed: case SuperA:
0
1649 return QCoreApplication::translate("QPageSize", "Super A");
never executed: return QCoreApplication::translate("QPageSize", "Super A");
0
1650 case SuperB:
never executed: case SuperB:
0
1651 return QCoreApplication::translate("QPageSize", "Super B");
never executed: return QCoreApplication::translate("QPageSize", "Super B");
0
1652 case Postcard:
never executed: case Postcard:
0
1653 return QCoreApplication::translate("QPageSize", "Postcard");
never executed: return QCoreApplication::translate("QPageSize", "Postcard");
0
1654 case DoublePostcard:
never executed: case DoublePostcard:
0
1655 return QCoreApplication::translate("QPageSize", "Double Postcard");
never executed: return QCoreApplication::translate("QPageSize", "Double Postcard");
0
1656 case Prc16K:
never executed: case Prc16K:
0
1657 return QCoreApplication::translate("QPageSize", "PRC 16K");
never executed: return QCoreApplication::translate("QPageSize", "PRC 16K");
0
1658 case Prc32K:
never executed: case Prc32K:
0
1659 return QCoreApplication::translate("QPageSize", "PRC 32K");
never executed: return QCoreApplication::translate("QPageSize", "PRC 32K");
0
1660 case Prc32KBig:
never executed: case Prc32KBig:
0
1661 return QCoreApplication::translate("QPageSize", "PRC 32K Big");
never executed: return QCoreApplication::translate("QPageSize", "PRC 32K Big");
0
1662 case FanFoldUS:
never executed: case FanFoldUS:
0
1663 return QCoreApplication::translate("QPageSize", "Fan-fold US (14.875 x 11 in)");
never executed: return QCoreApplication::translate("QPageSize", "Fan-fold US (14.875 x 11 in)");
0
1664 case FanFoldGerman:
never executed: case FanFoldGerman:
0
1665 return QCoreApplication::translate("QPageSize", "Fan-fold German (8.5 x 12 in)");
never executed: return QCoreApplication::translate("QPageSize", "Fan-fold German (8.5 x 12 in)");
0
1666 case FanFoldGermanLegal:
never executed: case FanFoldGermanLegal:
0
1667 return QCoreApplication::translate("QPageSize", "Fan-fold German Legal (8.5 x 13 in)");
never executed: return QCoreApplication::translate("QPageSize", "Fan-fold German Legal (8.5 x 13 in)");
0
1668 case EnvelopeB4:
never executed: case EnvelopeB4:
0
1669 return QCoreApplication::translate("QPageSize", "Envelope B4");
never executed: return QCoreApplication::translate("QPageSize", "Envelope B4");
0
1670 case EnvelopeB5:
never executed: case EnvelopeB5:
0
1671 return QCoreApplication::translate("QPageSize", "Envelope B5");
never executed: return QCoreApplication::translate("QPageSize", "Envelope B5");
0
1672 case EnvelopeB6:
never executed: case EnvelopeB6:
0
1673 return QCoreApplication::translate("QPageSize", "Envelope B6");
never executed: return QCoreApplication::translate("QPageSize", "Envelope B6");
0
1674 case EnvelopeC0:
never executed: case EnvelopeC0:
0
1675 return QCoreApplication::translate("QPageSize", "Envelope C0");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C0");
0
1676 case EnvelopeC1:
never executed: case EnvelopeC1:
0
1677 return QCoreApplication::translate("QPageSize", "Envelope C1");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C1");
0
1678 case EnvelopeC2:
never executed: case EnvelopeC2:
0
1679 return QCoreApplication::translate("QPageSize", "Envelope C2");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C2");
0
1680 case EnvelopeC3:
never executed: case EnvelopeC3:
0
1681 return QCoreApplication::translate("QPageSize", "Envelope C3");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C3");
0
1682 case EnvelopeC4:
never executed: case EnvelopeC4:
0
1683 return QCoreApplication::translate("QPageSize", "Envelope C4");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C4");
0
1684 case EnvelopeC5: // C5E
never executed: case EnvelopeC5:
0
1685 return QCoreApplication::translate("QPageSize", "Envelope C5");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C5");
0
1686 case EnvelopeC6:
never executed: case EnvelopeC6:
0
1687 return QCoreApplication::translate("QPageSize", "Envelope C6");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C6");
0
1688 case EnvelopeC65:
never executed: case EnvelopeC65:
0
1689 return QCoreApplication::translate("QPageSize", "Envelope C65");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C65");
0
1690 case EnvelopeC7:
never executed: case EnvelopeC7:
0
1691 return QCoreApplication::translate("QPageSize", "Envelope C7");
never executed: return QCoreApplication::translate("QPageSize", "Envelope C7");
0
1692 case EnvelopeDL: // DLE:
never executed: case EnvelopeDL:
0
1693 return QCoreApplication::translate("QPageSize", "Envelope DL");
never executed: return QCoreApplication::translate("QPageSize", "Envelope DL");
0
1694 case Envelope9:
never executed: case Envelope9:
0
1695 return QCoreApplication::translate("QPageSize", "Envelope US 9");
never executed: return QCoreApplication::translate("QPageSize", "Envelope US 9");
0
1696 case Envelope10: // Comm10E
never executed: case Envelope10:
0
1697 return QCoreApplication::translate("QPageSize", "Envelope US 10");
never executed: return QCoreApplication::translate("QPageSize", "Envelope US 10");
0
1698 case Envelope11:
never executed: case Envelope11:
0
1699 return QCoreApplication::translate("QPageSize", "Envelope US 11");
never executed: return QCoreApplication::translate("QPageSize", "Envelope US 11");
0
1700 case Envelope12:
never executed: case Envelope12:
0
1701 return QCoreApplication::translate("QPageSize", "Envelope US 12");
never executed: return QCoreApplication::translate("QPageSize", "Envelope US 12");
0
1702 case Envelope14:
never executed: case Envelope14:
0
1703 return QCoreApplication::translate("QPageSize", "Envelope US 14");
never executed: return QCoreApplication::translate("QPageSize", "Envelope US 14");
0
1704 case EnvelopeMonarch:
never executed: case EnvelopeMonarch:
0
1705 return QCoreApplication::translate("QPageSize", "Envelope Monarch");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Monarch");
0
1706 case EnvelopePersonal:
never executed: case EnvelopePersonal:
0
1707 return QCoreApplication::translate("QPageSize", "Envelope Personal");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Personal");
0
1708 case EnvelopeChou3:
never executed: case EnvelopeChou3:
0
1709 return QCoreApplication::translate("QPageSize", "Envelope Chou 3");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Chou 3");
0
1710 case EnvelopeChou4:
never executed: case EnvelopeChou4:
0
1711 return QCoreApplication::translate("QPageSize", "Envelope Chou 4");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Chou 4");
0
1712 case EnvelopeInvite:
never executed: case EnvelopeInvite:
0
1713 return QCoreApplication::translate("QPageSize", "Envelope Invite");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Invite");
0
1714 case EnvelopeItalian:
never executed: case EnvelopeItalian:
0
1715 return QCoreApplication::translate("QPageSize", "Envelope Italian");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Italian");
0
1716 case EnvelopeKaku2:
never executed: case EnvelopeKaku2:
0
1717 return QCoreApplication::translate("QPageSize", "Envelope Kaku 2");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Kaku 2");
0
1718 case EnvelopeKaku3:
never executed: case EnvelopeKaku3:
0
1719 return QCoreApplication::translate("QPageSize", "Envelope Kaku 3");
never executed: return QCoreApplication::translate("QPageSize", "Envelope Kaku 3");
0
1720 case EnvelopePrc1:
never executed: case EnvelopePrc1:
0
1721 return QCoreApplication::translate("QPageSize", "Envelope PRC 1");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 1");
0
1722 case EnvelopePrc2:
never executed: case EnvelopePrc2:
0
1723 return QCoreApplication::translate("QPageSize", "Envelope PRC 2");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 2");
0
1724 case EnvelopePrc3:
never executed: case EnvelopePrc3:
0
1725 return QCoreApplication::translate("QPageSize", "Envelope PRC 3");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 3");
0
1726 case EnvelopePrc4:
never executed: case EnvelopePrc4:
0
1727 return QCoreApplication::translate("QPageSize", "Envelope PRC 4");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 4");
0
1728 case EnvelopePrc5:
never executed: case EnvelopePrc5:
0
1729 return QCoreApplication::translate("QPageSize", "Envelope PRC 5");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 5");
0
1730 case EnvelopePrc6:
never executed: case EnvelopePrc6:
0
1731 return QCoreApplication::translate("QPageSize", "Envelope PRC 6");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 6");
0
1732 case EnvelopePrc7:
never executed: case EnvelopePrc7:
0
1733 return QCoreApplication::translate("QPageSize", "Envelope PRC 7");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 7");
0
1734 case EnvelopePrc8:
never executed: case EnvelopePrc8:
0
1735 return QCoreApplication::translate("QPageSize", "Envelope PRC 8");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 8");
0
1736 case EnvelopePrc9:
never executed: case EnvelopePrc9:
0
1737 return QCoreApplication::translate("QPageSize", "Envelope PRC 9");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 9");
0
1738 case EnvelopePrc10:
never executed: case EnvelopePrc10:
0
1739 return QCoreApplication::translate("QPageSize", "Envelope PRC 10");
never executed: return QCoreApplication::translate("QPageSize", "Envelope PRC 10");
0
1740 case EnvelopeYou4:
never executed: case EnvelopeYou4:
0
1741 return QCoreApplication::translate("QPageSize", "Envelope You 4");
never executed: return QCoreApplication::translate("QPageSize", "Envelope You 4");
0
1742 }-
1743 return QString();
never executed: return QString();
0
1744}-
1745-
1746/*!-
1747 Returns the standard QPageSize::PageSizeId of the given \a pointSize in-
1748 points using the given \a matchPolicy.-
1749-
1750 If using FuzzyMatch then the point size of the PageSizeId returned may not-
1751 exactly match the \a pointSize you passed in. You should call-
1752 QPageSize::sizePoints() using the returned PageSizeId to find out the actual-
1753 point size of the PageSizeId before using it in any calculations.-
1754*/-
1755-
1756QPageSize::PageSizeId QPageSize::id(const QSize &pointSize, SizeMatchPolicy matchPolicy)-
1757{-
1758 return qt_idForPointSize(pointSize, matchPolicy, 0);
never executed: return qt_idForPointSize(pointSize, matchPolicy, 0);
0
1759}-
1760-
1761/*!-
1762 Returns the standard QPageSize::PageSizeId of the given \a size in \a units-
1763 using the given \a matchPolicy.-
1764-
1765 If using FuzzyMatch then the unit size of the PageSizeId returned may not-
1766 exactly match the \a size you passed in. You should call-
1767 QPageSize::size() using the returned PageSizeId to find out the actual-
1768 unit size of the PageSizeId before using it in any calculations.-
1769*/-
1770-
1771QPageSize::PageSizeId QPageSize::id(const QSizeF &size, Unit units,-
1772 SizeMatchPolicy matchPolicy)-
1773{-
1774 return qt_idForSize(size, units, matchPolicy, 0);
never executed: return qt_idForSize(size, units, matchPolicy, 0);
0
1775}-
1776-
1777/*!-
1778 Returns the PageSizeId for the given Windows DMPAPER enum value \a windowsId.-
1779-
1780 If there is no matching PageSizeId then QPageSize::Custom is returned.-
1781*/-
1782-
1783QPageSize::PageSizeId QPageSize::id(int windowsId)-
1784{-
1785 return qt_idForWindowsID(windowsId);
never executed: return qt_idForWindowsID(windowsId);
0
1786}-
1787-
1788/*!-
1789 Returns the Windows DMPAPER enum value of the standard \a pageSizeId.-
1790-
1791 Not all valid PPD page sizes have a Windows equivalent, in which case 0-
1792 will be returned.-
1793*/-
1794-
1795int QPageSize::windowsId(PageSizeId pageSizeId)-
1796{-
1797 return qt_pageSizes[pageSizeId].windowsId;
never executed: return qt_pageSizes[pageSizeId].windowsId;
0
1798}-
1799-
1800/*!-
1801 Returns the definition size of the standard \a pageSizeId.-
1802-
1803 To obtain the definition units, call QPageSize::definitionUnits().-
1804*/-
1805-
1806QSizeF QPageSize::definitionSize(PageSizeId pageSizeId)-
1807{-
1808 if (pageSizeId == Custom)
pageSizeId == CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
1809 return QSizeF();
never executed: return QSizeF();
0
1810 return qt_definitionSize(pageSizeId);
never executed: return qt_definitionSize(pageSizeId);
0
1811}-
1812-
1813/*!-
1814 Returns the definition units of the standard \a pageSizeId.-
1815-
1816 To obtain the definition size, call QPageSize::definitionSize().-
1817*/-
1818-
1819QPageSize::Unit QPageSize::definitionUnits(PageSizeId pageSizeId)-
1820{-
1821 if (pageSizeId == Custom)
pageSizeId == CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
1822 return Unit(-1);
never executed: return Unit(-1);
0
1823 return qt_pageSizes[pageSizeId].definitionUnits;
never executed: return qt_pageSizes[pageSizeId].definitionUnits;
0
1824}-
1825-
1826/*!-
1827 Returns the size of the standard \a pageSizeId in the requested \a units.-
1828*/-
1829-
1830QSizeF QPageSize::size(PageSizeId pageSizeId, Unit units)-
1831{-
1832 if (pageSizeId == Custom)
pageSizeId == CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
1833 return QSizeF();
never executed: return QSizeF();
0
1834 return qt_unitSize(pageSizeId, units);
never executed: return qt_unitSize(pageSizeId, units);
0
1835}-
1836-
1837/*!-
1838 Returns the size of the standard \a pageSizeId in Points.-
1839*/-
1840-
1841QSize QPageSize::sizePoints(PageSizeId pageSizeId)-
1842{-
1843 if (pageSizeId == Custom)
pageSizeId == CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
1844 return QSize();
never executed: return QSize();
0
1845 return QSize(qt_pageSizes[pageSizeId].widthPoints, qt_pageSizes[pageSizeId].heightPoints);
never executed: return QSize(qt_pageSizes[pageSizeId].widthPoints, qt_pageSizes[pageSizeId].heightPoints);
0
1846}-
1847-
1848/*!-
1849 Returns the size of the standard \a pageSizeId in Device Pixels-
1850 for the given \a resolution.-
1851*/-
1852-
1853QSize QPageSize::sizePixels(PageSizeId pageSizeId, int resolution)-
1854{-
1855 if (pageSizeId == Custom)
pageSizeId == CustomDescription
TRUEnever evaluated
FALSEnever evaluated
0
1856 return QSize();
never executed: return QSize();
0
1857 return qt_convertPointsToPixels(sizePoints(pageSizeId), resolution);
never executed: return qt_convertPointsToPixels(sizePoints(pageSizeId), resolution);
0
1858}-
1859-
1860#ifndef QT_NO_DEBUG_STREAM-
1861QDebug operator<<(QDebug dbg, const QPageSize &pageSize)-
1862{-
1863 QDebugStateSaver saver(dbg);-
1864 dbg.nospace();-
1865 dbg.noquote();-
1866 dbg << "QPageSize(";-
1867 if (pageSize.isValid()) {
pageSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1868 dbg << '"' << pageSize.name() << "\", key=\"" << pageSize.key()-
1869 << "\", " << pageSize.sizePoints().width() << 'x'-
1870 << pageSize.sizePoints().height() << "pt, id=" << pageSize.id();-
1871 } else {
never executed: end of block
0
1872 dbg.nospace() << "QPageSize()";-
1873 }
never executed: end of block
0
1874 dbg << ')';-
1875 return dbg;
never executed: return dbg;
0
1876}-
1877#endif-
1878-
1879QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9