Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | class QPdfWriterPrivate : public QObjectPrivate | - |
5 | { | - |
6 | public: | - |
7 | QPdfWriterPrivate() | - |
8 | : QObjectPrivate() | - |
9 | { | - |
10 | engine = new QPdfEngine(); | - |
11 | output = 0; | - |
12 | } | 0 |
13 | ~QPdfWriterPrivate() | - |
14 | { | - |
15 | delete engine; | - |
16 | delete output; | - |
17 | } | 0 |
18 | | - |
19 | QPdfEngine *engine; | - |
20 | QFile *output; | - |
21 | }; | - |
22 | QPdfWriter::QPdfWriter(const QString &filename) | - |
23 | : QObject(*new QPdfWriterPrivate) | - |
24 | { | - |
25 | QPdfWriterPrivate * const d = d_func(); | - |
26 | | - |
27 | d->engine->setOutputFilename(filename); | - |
28 | } | 0 |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | QPdfWriter::QPdfWriter(QIODevice *device) | - |
34 | : QObject(*new QPdfWriterPrivate) | - |
35 | { | - |
36 | QPdfWriterPrivate * const d = d_func(); | - |
37 | | - |
38 | d->engine->d_func()->outDevice = device; | - |
39 | } | 0 |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | QPdfWriter::~QPdfWriter() | - |
45 | { | - |
46 | | - |
47 | } | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | QString QPdfWriter::title() const | - |
53 | { | - |
54 | const QPdfWriterPrivate * const d = d_func(); | - |
55 | return d->engine->d_func()->title; never executed: return d->engine->d_func()->title; | 0 |
56 | } | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | void QPdfWriter::setTitle(const QString &title) | - |
62 | { | - |
63 | QPdfWriterPrivate * const d = d_func(); | - |
64 | d->engine->d_func()->title = title; | - |
65 | } | 0 |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | QString QPdfWriter::creator() const | - |
71 | { | - |
72 | const QPdfWriterPrivate * const d = d_func(); | - |
73 | return d->engine->d_func()->creator; never executed: return d->engine->d_func()->creator; | 0 |
74 | } | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | void QPdfWriter::setCreator(const QString &creator) | - |
80 | { | - |
81 | QPdfWriterPrivate * const d = d_func(); | - |
82 | d->engine->d_func()->creator = creator; | - |
83 | } | 0 |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | QPaintEngine *QPdfWriter::paintEngine() const | - |
90 | { | - |
91 | const QPdfWriterPrivate * const d = d_func(); | - |
92 | | - |
93 | return d->engine; never executed: return d->engine; | 0 |
94 | } | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | void QPdfWriter::setPageSize(PageSize size) | - |
100 | { | - |
101 | const QPdfWriterPrivate * const d = d_func(); | - |
102 | | - |
103 | QPagedPaintDevice::setPageSize(size); | - |
104 | d->engine->d_func()->paperSize = pageSizeMM() * 25.4/72.; | - |
105 | } | 0 |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | void QPdfWriter::setPageSizeMM(const QSizeF &size) | - |
111 | { | - |
112 | const QPdfWriterPrivate * const d = d_func(); | - |
113 | | - |
114 | QPagedPaintDevice::setPageSizeMM(size); | - |
115 | d->engine->d_func()->paperSize = pageSizeMM() * 25.4/72.; | - |
116 | } | 0 |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
122 | | - |
123 | int QPdfWriter::metric(PaintDeviceMetric id) const | - |
124 | { | - |
125 | const QPdfWriterPrivate * const d = d_func(); | - |
126 | return d->engine->metric(id); never executed: return d->engine->metric(id); | 0 |
127 | } | - |
128 | | - |
129 | | - |
130 | | - |
131 | | - |
132 | bool QPdfWriter::newPage() | - |
133 | { | - |
134 | QPdfWriterPrivate * const d = d_func(); | - |
135 | | - |
136 | return d->engine->newPage(); never executed: return d->engine->newPage(); | 0 |
137 | } | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | void QPdfWriter::setMargins(const Margins &m) | - |
144 | { | - |
145 | QPdfWriterPrivate * const d = d_func(); | - |
146 | | - |
147 | const qreal multiplier = 72./25.4; | - |
148 | d->engine->d_func()->leftMargin = m.left*multiplier; | - |
149 | d->engine->d_func()->rightMargin = m.right*multiplier; | - |
150 | d->engine->d_func()->topMargin = m.top*multiplier; | - |
151 | d->engine->d_func()->bottomMargin = m.bottom*multiplier; | - |
152 | } | 0 |
153 | | - |
154 | | - |
155 | | - |
| | |