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