qprintdevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/printsupport/kernel/qprintdevice.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7QPrintDevice::QPrintDevice()-
8 : d(new QPlatformPrintDevice())-
9{-
10}
executed 144 times by 3 tests: end of block
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
  • tst_QPrinterInfo
144
11-
12QPrintDevice::QPrintDevice(const QString &id)-
13 : d(new QPlatformPrintDevice(id))-
14{-
15}
never executed: end of block
0
16-
17QPrintDevice::QPrintDevice(QPlatformPrintDevice *dd)-
18 : d(dd)-
19{-
20}
executed 5 times by 1 test: end of block
Executed by:
  • tst_QPrinter
5
21-
22QPrintDevice::QPrintDevice(const QPrintDevice &other)-
23 : d(other.d)-
24{-
25}
executed 136 times by 2 tests: end of block
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
136
26-
27QPrintDevice::~QPrintDevice()-
28{-
29}-
30-
31QPrintDevice &QPrintDevice::operator=(const QPrintDevice &other)-
32{-
33 d = other.d;-
34 return
never executed: return *this;
*this;
never executed: return *this;
0
35}-
36-
37bool QPrintDevice::operator==(const QPrintDevice &other) const-
38{-
39 if (d
dDescription
TRUEnever evaluated
FALSEnever evaluated
&& other.d
other.dDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
40 return
never executed: return d->id() == other.d->id();
d->id() == other.d->id();
never executed: return d->id() == other.d->id();
0
41 return
never executed: return d == other.d;
d == other.d;
never executed: return d == other.d;
0
42}-
43-
44QString QPrintDevice::id() const-
45{-
46 return
executed 6 times by 2 tests: return isValid() ? d->id() : QString();
Executed by:
  • tst_QPrinter
  • tst_QPrinterInfo
isValid() ? d->id() : QString();
executed 6 times by 2 tests: return isValid() ? d->id() : QString();
Executed by:
  • tst_QPrinter
  • tst_QPrinterInfo
6
47}-
48-
49QString QPrintDevice::name() const-
50{-
51 return
never executed: return isValid() ? d->name() : QString();
isValid() ? d->name() : QString();
never executed: return isValid() ? d->name() : QString();
0
52}-
53-
54QString QPrintDevice::location() const-
55{-
56 return
executed 4 times by 1 test: return isValid() ? d->location() : QString();
Executed by:
  • tst_QPrinter
isValid() ? d->location() : QString();
executed 4 times by 1 test: return isValid() ? d->location() : QString();
Executed by:
  • tst_QPrinter
4
57}-
58-
59QString QPrintDevice::makeAndModel() const-
60{-
61 return
executed 4 times by 1 test: return isValid() ? d->makeAndModel() : QString();
Executed by:
  • tst_QPrinter
isValid() ? d->makeAndModel() : QString();
executed 4 times by 1 test: return isValid() ? d->makeAndModel() : QString();
Executed by:
  • tst_QPrinter
4
62}-
63-
64bool QPrintDevice::isValid() const-
65{-
66 return
executed 285 times by 3 tests: return d && d->isValid();
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
  • tst_QPrinterInfo
d && d->isValid();
executed 285 times by 3 tests: return d && d->isValid();
Executed by:
  • tst_QAbstractPrintDialog
  • tst_QPrinter
  • tst_QPrinterInfo
285
67}-
68-
69bool QPrintDevice::isDefault() const-
70{-
71 return
never executed: return isValid() && d->isDefault();
isValid() && d->isDefault();
never executed: return isValid() && d->isDefault();
0
72}-
73-
74bool QPrintDevice::isRemote() const-
75{-
76 return
never executed: return isValid() && d->isRemote();
isValid() && d->isRemote();
never executed: return isValid() && d->isRemote();
0
77}-
78-
79QPrint::DeviceState QPrintDevice::state() const-
80{-
81 return
never executed: return isValid() ? d->state() : QPrint::Error;
isValid() ? d->state() : QPrint::Error;
never executed: return isValid() ? d->state() : QPrint::Error;
0
82}-
83-
84bool QPrintDevice::isValidPageLayout(const QPageLayout &layout, int resolution) const-
85{-
86 return
never executed: return isValid() && d->isValidPageLayout(layout, resolution);
isValid() && d->isValidPageLayout(layout, resolution);
never executed: return isValid() && d->isValidPageLayout(layout, resolution);
0
87}-
88-
89bool QPrintDevice::supportsMultipleCopies() const-
90{-
91 return
never executed: return isValid() && d->supportsMultipleCopies();
isValid() && d->supportsMultipleCopies();
never executed: return isValid() && d->supportsMultipleCopies();
0
92}-
93-
94bool QPrintDevice::supportsCollateCopies() const-
95{-
96 return
never executed: return isValid() && d->supportsCollateCopies();
isValid() && d->supportsCollateCopies();
never executed: return isValid() && d->supportsCollateCopies();
0
97}-
98-
99QPageSize QPrintDevice::defaultPageSize() const-
100{-
101 return
never executed: return isValid() ? d->defaultPageSize() : QPageSize();
isValid() ? d->defaultPageSize() : QPageSize();
never executed: return isValid() ? d->defaultPageSize() : QPageSize();
0
102}-
103-
104QList<QPageSize> QPrintDevice::supportedPageSizes() const-
105{-
106 return
executed 2 times by 1 test: return isValid() ? d->supportedPageSizes() : QList<QPageSize>();
Executed by:
  • tst_QPrinter
isValid() ? d->supportedPageSizes() : QList<QPageSize>();
executed 2 times by 1 test: return isValid() ? d->supportedPageSizes() : QList<QPageSize>();
Executed by:
  • tst_QPrinter
2
107}-
108-
109QPageSize QPrintDevice::supportedPageSize(const QPageSize &pageSize) const-
110{-
111 return
never executed: return isValid() ? d->supportedPageSize(pageSize) : QPageSize();
isValid() ? d->supportedPageSize(pageSize) : QPageSize();
never executed: return isValid() ? d->supportedPageSize(pageSize) : QPageSize();
0
112}-
113-
114QPageSize QPrintDevice::supportedPageSize(QPageSize::PageSizeId pageSizeId) const-
115{-
116 return
never executed: return isValid() ? d->supportedPageSize(pageSizeId) : QPageSize();
isValid() ? d->supportedPageSize(pageSizeId) : QPageSize();
never executed: return isValid() ? d->supportedPageSize(pageSizeId) : QPageSize();
0
117}-
118-
119QPageSize QPrintDevice::supportedPageSize(const QString &pageName) const-
120{-
121 return
never executed: return isValid() ? d->supportedPageSize(pageName) : QPageSize();
isValid() ? d->supportedPageSize(pageName) : QPageSize();
never executed: return isValid() ? d->supportedPageSize(pageName) : QPageSize();
0
122}-
123-
124QPageSize QPrintDevice::supportedPageSize(const QSize &pointSize) const-
125{-
126 return
never executed: return isValid() ? d->supportedPageSize(pointSize) : QPageSize();
isValid() ? d->supportedPageSize(pointSize) : QPageSize();
never executed: return isValid() ? d->supportedPageSize(pointSize) : QPageSize();
0
127}-
128-
129QPageSize QPrintDevice::supportedPageSize(const QSizeF &size, QPageSize::Unit units) const-
130{-
131 return
never executed: return isValid() ? d->supportedPageSize(size, units) : QPageSize();
isValid() ? d->supportedPageSize(size, units) : QPageSize();
never executed: return isValid() ? d->supportedPageSize(size, units) : QPageSize();
0
132}-
133-
134bool QPrintDevice::supportsCustomPageSizes() const-
135{-
136 return
never executed: return isValid() && d->supportsCustomPageSizes();
isValid() && d->supportsCustomPageSizes();
never executed: return isValid() && d->supportsCustomPageSizes();
0
137}-
138-
139QSize QPrintDevice::minimumPhysicalPageSize() const-
140{-
141 return
never executed: return isValid() ? d->minimumPhysicalPageSize() : QSize();
isValid() ? d->minimumPhysicalPageSize() : QSize();
never executed: return isValid() ? d->minimumPhysicalPageSize() : QSize();
0
142}-
143-
144QSize QPrintDevice::maximumPhysicalPageSize() const-
145{-
146 return
never executed: return isValid() ? d->maximumPhysicalPageSize() : QSize();
isValid() ? d->maximumPhysicalPageSize() : QSize();
never executed: return isValid() ? d->maximumPhysicalPageSize() : QSize();
0
147}-
148-
149QMarginsF QPrintDevice::printableMargins(const QPageSize &pageSize,-
150 QPageLayout::Orientation orientation,-
151 int resolution) const-
152{-
153 return
never executed: return isValid() ? d->printableMargins(pageSize, orientation, resolution) : QMarginsF();
isValid() ? d->printableMargins(pageSize, orientation, resolution) : QMarginsF();
never executed: return isValid() ? d->printableMargins(pageSize, orientation, resolution) : QMarginsF();
0
154}-
155-
156int QPrintDevice::defaultResolution() const-
157{-
158 return
never executed: return isValid() ? d->defaultResolution() : 0;
isValid() ? d->defaultResolution() : 0;
never executed: return isValid() ? d->defaultResolution() : 0;
0
159}-
160-
161QList<int> QPrintDevice::supportedResolutions() const-
162{-
163 return
never executed: return isValid() ? d->supportedResolutions() : QList<int>();
isValid() ? d->supportedResolutions() : QList<int>();
never executed: return isValid() ? d->supportedResolutions() : QList<int>();
0
164}-
165-
166QPrint::InputSlot QPrintDevice::defaultInputSlot() const-
167{-
168 return
never executed: return isValid() ? d->defaultInputSlot() : QPrint::InputSlot();
isValid() ? d->defaultInputSlot() : QPrint::InputSlot();
never executed: return isValid() ? d->defaultInputSlot() : QPrint::InputSlot();
0
169}-
170-
171QList<QPrint::InputSlot> QPrintDevice::supportedInputSlots() const-
172{-
173 return
never executed: return isValid() ? d->supportedInputSlots() : QList<QPrint::InputSlot>();
isValid() ? d->supportedInputSlots() : QList<QPrint::InputSlot>();
never executed: return isValid() ? d->supportedInputSlots() : QList<QPrint::InputSlot>();
0
174}-
175-
176QPrint::OutputBin QPrintDevice::defaultOutputBin() const-
177{-
178 return
never executed: return isValid() ? d->defaultOutputBin() : QPrint::OutputBin();
isValid() ? d->defaultOutputBin() : QPrint::OutputBin();
never executed: return isValid() ? d->defaultOutputBin() : QPrint::OutputBin();
0
179}-
180-
181QList<QPrint::OutputBin> QPrintDevice::supportedOutputBins() const-
182{-
183 return
never executed: return isValid() ? d->supportedOutputBins() : QList<QPrint::OutputBin>();
isValid() ? d->supportedOutputBins() : QList<QPrint::OutputBin>();
never executed: return isValid() ? d->supportedOutputBins() : QList<QPrint::OutputBin>();
0
184}-
185-
186QPrint::DuplexMode QPrintDevice::defaultDuplexMode() const-
187{-
188 return
never executed: return isValid() ? d->defaultDuplexMode() : QPrint::DuplexNone;
isValid() ? d->defaultDuplexMode() : QPrint::DuplexNone;
never executed: return isValid() ? d->defaultDuplexMode() : QPrint::DuplexNone;
0
189}-
190-
191QList<QPrint::DuplexMode> QPrintDevice::supportedDuplexModes() const-
192{-
193 return
never executed: return isValid() ? d->supportedDuplexModes() : QList<QPrint::DuplexMode>();
isValid() ? d->supportedDuplexModes() : QList<QPrint::DuplexMode>();
never executed: return isValid() ? d->supportedDuplexModes() : QList<QPrint::DuplexMode>();
0
194}-
195-
196QPrint::ColorMode QPrintDevice::defaultColorMode() const-
197{-
198 return
never executed: return isValid() ? d->defaultColorMode() : QPrint::GrayScale;
isValid() ? d->defaultColorMode() : QPrint::GrayScale;
never executed: return isValid() ? d->defaultColorMode() : QPrint::GrayScale;
0
199}-
200-
201QList<QPrint::ColorMode> QPrintDevice::supportedColorModes() const-
202{-
203 return
never executed: return isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>();
isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>();
never executed: return isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>();
0
204}-
205-
206-
207QList<QMimeType> QPrintDevice::supportedMimeTypes() const-
208{-
209 return
never executed: return isValid() ? d->supportedMimeTypes() : QList<QMimeType>();
isValid() ? d->supportedMimeTypes() : QList<QMimeType>();
never executed: return isValid() ? d->supportedMimeTypes() : QList<QMimeType>();
0
210}-
211-
212-
213-
214void QPrintDevice::format(QDebug debug) const-
215{-
216 QDebugStateSaver saver(debug);-
217 debug.noquote();-
218 debug.nospace();-
219 if (isValid()
isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
220 const QString deviceId = id();-
221 const QString deviceName = name();-
222 debug << "id=\"" << deviceId << "\", state=" << state();-
223 if (!deviceName.isEmpty()
!deviceName.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& deviceName != deviceId
deviceName != deviceIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
224 debug << ", name=\"" << deviceName << '"';
never executed: debug << ", name=\"" << deviceName << '"';
0
225 if (!location().isEmpty()
!location().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
226 debug << ", location=\"" << location() << '"';
never executed: debug << ", location=\"" << location() << '"';
0
227 debug << ", makeAndModel=\"" << makeAndModel() << '"';-
228 if (isDefault()
isDefault()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
229 debug << ", default";
never executed: debug << ", default";
0
230 if (isRemote()
isRemote()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
231 debug << ", remote";
never executed: debug << ", remote";
0
232 debug << ", defaultPageSize=" << defaultPageSize();-
233 if (supportsCustomPageSizes()
supportsCustomPageSizes()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
234 debug << ", supportsCustomPageSizes";
never executed: debug << ", supportsCustomPageSizes";
0
235 debug << ", physicalPageSize=(";-
236 QtDebugUtils::formatQSize(debug, minimumPhysicalPageSize());-
237 debug << ")..(";-
238 QtDebugUtils::formatQSize(debug, maximumPhysicalPageSize());-
239 debug << "), defaultResolution=" << defaultResolution()-
240 << ", defaultDuplexMode=" << defaultDuplexMode()-
241 << ", defaultColorMode="<< defaultColorMode();-
242-
243 const QList<QMimeType> mimeTypes = supportedMimeTypes();-
244 if (!mimeTypes.isEmpty()
!mimeTypes.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
245 debug << ", supportedMimeTypes=(";-
246 for (const auto &mimeType : mimeTypes)-
247 debug << " \"" << mimeType.name() << '"';
never executed: debug << " \"" << mimeType.name() << '"';
0
248 debug << ')';-
249 }
never executed: end of block
0
250-
251 }
never executed: end of block
else {
0
252 debug << "null";-
253 }
never executed: end of block
0
254}-
255-
256QDebug operator<<(QDebug debug, const QPrintDevice &p)-
257{-
258 QDebugStateSaver saver(debug);-
259 debug.nospace();-
260 debug << "QPrintDevice(";-
261 p.format(debug);-
262 debug << ')';-
263 return
never executed: return debug;
debug;
never executed: return debug;
0
264}-
265-
266-
267-
268-
Switch to Source codePreprocessed file

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