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

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