Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickimagebase.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | - | |||||||||||||||||||
6 | - | |||||||||||||||||||
7 | - | |||||||||||||||||||
8 | bool QQuickImageBasePrivate::updateDevicePixelRatio(qreal targetDevicePixelRatio) | - | ||||||||||||||||||
9 | { | - | ||||||||||||||||||
10 | - | |||||||||||||||||||
11 | - | |||||||||||||||||||
12 | - | |||||||||||||||||||
13 | bool setDevicePixelRatio = false; | - | ||||||||||||||||||
14 | if (url.scheme() == QLatin1String("image")
| 12-22 | ||||||||||||||||||
15 | setDevicePixelRatio = true; | - | ||||||||||||||||||
16 | } executed 12 times by 2 tests: else {end of block Executed by:
| 12 | ||||||||||||||||||
17 | QString stringUrl = url.path(QUrl::PrettyDecoded); | - | ||||||||||||||||||
18 | if (stringUrl.endsWith(QLatin1String("svg"))
| 0-22 | ||||||||||||||||||
19 | stringUrl.endsWith(QLatin1String("svgz"))
| 0-22 | ||||||||||||||||||
20 | setDevicePixelRatio = true; | - | ||||||||||||||||||
21 | } never executed: end of block | 0 | ||||||||||||||||||
22 | } executed 22 times by 3 tests: end of block Executed by:
| 22 | ||||||||||||||||||
23 | - | |||||||||||||||||||
24 | if (setDevicePixelRatio
| 12-22 | ||||||||||||||||||
25 | devicePixelRatio = targetDevicePixelRatio; executed 12 times by 2 tests: devicePixelRatio = targetDevicePixelRatio; Executed by:
| 12 | ||||||||||||||||||
26 | - | |||||||||||||||||||
27 | return executed 34 times by 4 tests: setDevicePixelRatio;return setDevicePixelRatio; Executed by:
executed 34 times by 4 tests: return setDevicePixelRatio; Executed by:
| 34 | ||||||||||||||||||
28 | } | - | ||||||||||||||||||
29 | - | |||||||||||||||||||
30 | QQuickImageBase::QQuickImageBase(QQuickItem *parent) | - | ||||||||||||||||||
31 | : QQuickImplicitSizeItem(*(new QQuickImageBasePrivate), parent) | - | ||||||||||||||||||
32 | { | - | ||||||||||||||||||
33 | setFlag(ItemHasContents); | - | ||||||||||||||||||
34 | } never executed: end of block | 0 | ||||||||||||||||||
35 | - | |||||||||||||||||||
36 | QQuickImageBase::QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent) | - | ||||||||||||||||||
37 | : QQuickImplicitSizeItem(dd, parent) | - | ||||||||||||||||||
38 | { | - | ||||||||||||||||||
39 | setFlag(ItemHasContents); | - | ||||||||||||||||||
40 | } executed 5624 times by 15 tests: end of block Executed by:
| 5624 | ||||||||||||||||||
41 | - | |||||||||||||||||||
42 | QQuickImageBase::~QQuickImageBase() | - | ||||||||||||||||||
43 | { | - | ||||||||||||||||||
44 | } | - | ||||||||||||||||||
45 | - | |||||||||||||||||||
46 | QQuickImageBase::Status QQuickImageBase::status() const | - | ||||||||||||||||||
47 | { | - | ||||||||||||||||||
48 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
49 | return executed 1341 times by 5 tests: d->status;return d->status; Executed by:
executed 1341 times by 5 tests: return d->status; Executed by:
| 1341 | ||||||||||||||||||
50 | } | - | ||||||||||||||||||
51 | - | |||||||||||||||||||
52 | - | |||||||||||||||||||
53 | qreal QQuickImageBase::progress() const | - | ||||||||||||||||||
54 | { | - | ||||||||||||||||||
55 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
56 | return executed 260 times by 4 tests: d->progress;return d->progress; Executed by:
executed 260 times by 4 tests: return d->progress; Executed by:
| 260 | ||||||||||||||||||
57 | } | - | ||||||||||||||||||
58 | - | |||||||||||||||||||
59 | - | |||||||||||||||||||
60 | bool QQuickImageBase::asynchronous() const | - | ||||||||||||||||||
61 | { | - | ||||||||||||||||||
62 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
63 | return executed 28 times by 1 test: d->async;return d->async; Executed by:
executed 28 times by 1 test: return d->async; Executed by:
| 28 | ||||||||||||||||||
64 | } | - | ||||||||||||||||||
65 | - | |||||||||||||||||||
66 | void QQuickImageBase::setAsynchronous(bool async) | - | ||||||||||||||||||
67 | { | - | ||||||||||||||||||
68 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
69 | if (d->async != async
| 22-66 | ||||||||||||||||||
70 | d->async = async; | - | ||||||||||||||||||
71 | asynchronousChanged(); | - | ||||||||||||||||||
72 | } executed 66 times by 5 tests: end of block Executed by:
| 66 | ||||||||||||||||||
73 | } executed 88 times by 5 tests: end of block Executed by:
| 88 | ||||||||||||||||||
74 | - | |||||||||||||||||||
75 | QUrl QQuickImageBase::source() const | - | ||||||||||||||||||
76 | { | - | ||||||||||||||||||
77 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
78 | return executed 363 times by 7 tests: d->url;return d->url; Executed by:
executed 363 times by 7 tests: return d->url; Executed by:
| 363 | ||||||||||||||||||
79 | } | - | ||||||||||||||||||
80 | - | |||||||||||||||||||
81 | void QQuickImageBase::setSource(const QUrl &url) | - | ||||||||||||||||||
82 | { | - | ||||||||||||||||||
83 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
84 | - | |||||||||||||||||||
85 | if (url == d->url
| 14-5440 | ||||||||||||||||||
86 | return; executed 14 times by 1 test: return; Executed by:
| 14 | ||||||||||||||||||
87 | - | |||||||||||||||||||
88 | d->url = url; | - | ||||||||||||||||||
89 | sourceChanged(d->url); | - | ||||||||||||||||||
90 | - | |||||||||||||||||||
91 | if (isComponentComplete()
| 74-5366 | ||||||||||||||||||
92 | load(); executed 74 times by 3 tests: load(); Executed by:
| 74 | ||||||||||||||||||
93 | } executed 5440 times by 12 tests: end of block Executed by:
| 5440 | ||||||||||||||||||
94 | - | |||||||||||||||||||
95 | void QQuickImageBase::setSourceSize(const QSize& size) | - | ||||||||||||||||||
96 | { | - | ||||||||||||||||||
97 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
98 | if (d->sourcesize == size
| 12-42 | ||||||||||||||||||
99 | return; executed 12 times by 2 tests: return; Executed by:
| 12 | ||||||||||||||||||
100 | - | |||||||||||||||||||
101 | d->sourcesize = size; | - | ||||||||||||||||||
102 | sourceSizeChanged(); | - | ||||||||||||||||||
103 | if (isComponentComplete()
| 4-38 | ||||||||||||||||||
104 | load(); executed 4 times by 1 test: load(); Executed by:
| 4 | ||||||||||||||||||
105 | } executed 42 times by 4 tests: end of block Executed by:
| 42 | ||||||||||||||||||
106 | - | |||||||||||||||||||
107 | QSize QQuickImageBase::sourceSize() const | - | ||||||||||||||||||
108 | { | - | ||||||||||||||||||
109 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
110 | - | |||||||||||||||||||
111 | int width = d->sourcesize.width(); | - | ||||||||||||||||||
112 | int height = d->sourcesize.height(); | - | ||||||||||||||||||
113 | return executed 11286 times by 10 tests: QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height());return QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height()); Executed by:
executed 11286 times by 10 tests: return QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height()); Executed by:
| 11286 | ||||||||||||||||||
114 | } | - | ||||||||||||||||||
115 | - | |||||||||||||||||||
116 | void QQuickImageBase::resetSourceSize() | - | ||||||||||||||||||
117 | { | - | ||||||||||||||||||
118 | setSourceSize(QSize()); | - | ||||||||||||||||||
119 | } never executed: end of block | 0 | ||||||||||||||||||
120 | - | |||||||||||||||||||
121 | bool QQuickImageBase::cache() const | - | ||||||||||||||||||
122 | { | - | ||||||||||||||||||
123 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
124 | return executed 30 times by 2 tests: d->cache;return d->cache; Executed by:
executed 30 times by 2 tests: return d->cache; Executed by:
| 30 | ||||||||||||||||||
125 | } | - | ||||||||||||||||||
126 | - | |||||||||||||||||||
127 | void QQuickImageBase::setCache(bool cache) | - | ||||||||||||||||||
128 | { | - | ||||||||||||||||||
129 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
130 | if (d->cache == cache
| 24-26 | ||||||||||||||||||
131 | return; executed 26 times by 1 test: return; Executed by:
| 26 | ||||||||||||||||||
132 | - | |||||||||||||||||||
133 | d->cache = cache; | - | ||||||||||||||||||
134 | cacheChanged(); | - | ||||||||||||||||||
135 | if (isComponentComplete()
| 0-24 | ||||||||||||||||||
136 | load(); never executed: load(); | 0 | ||||||||||||||||||
137 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||||||||||||||
138 | - | |||||||||||||||||||
139 | QImage QQuickImageBase::image() const | - | ||||||||||||||||||
140 | { | - | ||||||||||||||||||
141 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
142 | return executed 84 times by 1 test: d->pix.image();return d->pix.image(); Executed by:
executed 84 times by 1 test: return d->pix.image(); Executed by:
| 84 | ||||||||||||||||||
143 | } | - | ||||||||||||||||||
144 | - | |||||||||||||||||||
145 | void QQuickImageBase::setMirror(bool mirror) | - | ||||||||||||||||||
146 | { | - | ||||||||||||||||||
147 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
148 | if (mirror == d->mirror
| 0-24 | ||||||||||||||||||
149 | return; never executed: return; | 0 | ||||||||||||||||||
150 | - | |||||||||||||||||||
151 | d->mirror = mirror; | - | ||||||||||||||||||
152 | - | |||||||||||||||||||
153 | if (isComponentComplete()
| 2-22 | ||||||||||||||||||
154 | update(); executed 22 times by 3 tests: update(); Executed by:
| 22 | ||||||||||||||||||
155 | - | |||||||||||||||||||
156 | mirrorChanged(); | - | ||||||||||||||||||
157 | } executed 24 times by 4 tests: end of block Executed by:
| 24 | ||||||||||||||||||
158 | - | |||||||||||||||||||
159 | bool QQuickImageBase::mirror() const | - | ||||||||||||||||||
160 | { | - | ||||||||||||||||||
161 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
162 | return never executed: d->mirror;return d->mirror; never executed: return d->mirror; | 0 | ||||||||||||||||||
163 | } | - | ||||||||||||||||||
164 | - | |||||||||||||||||||
165 | void QQuickImageBase::load() | - | ||||||||||||||||||
166 | { | - | ||||||||||||||||||
167 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
168 | - | |||||||||||||||||||
169 | if (d->url.isEmpty()
| 8-5444 | ||||||||||||||||||
170 | d->pix.clear(this); | - | ||||||||||||||||||
171 | if (d->progress != 0.0
| 0-8 | ||||||||||||||||||
172 | d->progress = 0.0; | - | ||||||||||||||||||
173 | progressChanged(d->progress); | - | ||||||||||||||||||
174 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||
175 | pixmapChange(); | - | ||||||||||||||||||
176 | d->status = Null; | - | ||||||||||||||||||
177 | statusChanged(d->status); | - | ||||||||||||||||||
178 | - | |||||||||||||||||||
179 | if (sourceSize() != d->oldSourceSize
| 0-8 | ||||||||||||||||||
180 | d->oldSourceSize = sourceSize(); | - | ||||||||||||||||||
181 | sourceSizeChanged(); | - | ||||||||||||||||||
182 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||
183 | if (autoTransform() != d->oldAutoTransform
| 0-8 | ||||||||||||||||||
184 | d->oldAutoTransform = autoTransform(); | - | ||||||||||||||||||
185 | emitAutoTransformBaseChanged(); | - | ||||||||||||||||||
186 | } never executed: end of block | 0 | ||||||||||||||||||
187 | update(); | - | ||||||||||||||||||
188 | - | |||||||||||||||||||
189 | } executed 8 times by 1 test: else {end of block Executed by:
| 8 | ||||||||||||||||||
190 | QQuickPixmap::Options options; | - | ||||||||||||||||||
191 | if (d->async
| 66-5378 | ||||||||||||||||||
192 | options |= QQuickPixmap::Asynchronous; executed 66 times by 4 tests: options |= QQuickPixmap::Asynchronous; Executed by:
| 66 | ||||||||||||||||||
193 | if (d->cache
| 42-5402 | ||||||||||||||||||
194 | options |= QQuickPixmap::Cache; executed 5402 times by 11 tests: options |= QQuickPixmap::Cache; Executed by:
| 5402 | ||||||||||||||||||
195 | d->pix.clear(this); | - | ||||||||||||||||||
196 | - | |||||||||||||||||||
197 | const qreal targetDevicePixelRatio = (window()
| 2384-3060 | ||||||||||||||||||
198 | d->devicePixelRatio = 1.0; | - | ||||||||||||||||||
199 | - | |||||||||||||||||||
200 | QUrl loadUrl = d->url; | - | ||||||||||||||||||
201 | - | |||||||||||||||||||
202 | bool updatedDevicePixelRatio = false; | - | ||||||||||||||||||
203 | if (d->sourcesize.isValid()
| 34-5410 | ||||||||||||||||||
204 | updatedDevicePixelRatio = d->updateDevicePixelRatio(targetDevicePixelRatio); executed 34 times by 4 tests: updatedDevicePixelRatio = d->updateDevicePixelRatio(targetDevicePixelRatio); Executed by:
| 34 | ||||||||||||||||||
205 | - | |||||||||||||||||||
206 | if (!updatedDevicePixelRatio
| 12-5432 | ||||||||||||||||||
207 | - | |||||||||||||||||||
208 | - | |||||||||||||||||||
209 | resolve2xLocalFile(d->url, targetDevicePixelRatio, &loadUrl, &d->devicePixelRatio); | - | ||||||||||||||||||
210 | } executed 5432 times by 12 tests: end of block Executed by:
| 5432 | ||||||||||||||||||
211 | - | |||||||||||||||||||
212 | d->pix.load(qmlEngine(this), loadUrl, d->sourcesize * d->devicePixelRatio, options, d->providerOptions); | - | ||||||||||||||||||
213 | - | |||||||||||||||||||
214 | if (d->pix.isLoading()
| 126-5318 | ||||||||||||||||||
215 | if (d->progress != 0.0
| 10-116 | ||||||||||||||||||
216 | d->progress = 0.0; | - | ||||||||||||||||||
217 | progressChanged(d->progress); | - | ||||||||||||||||||
218 | } executed 10 times by 1 test: end of block Executed by:
| 10 | ||||||||||||||||||
219 | if (d->status != Loading
| 0-126 | ||||||||||||||||||
220 | d->status = Loading; | - | ||||||||||||||||||
221 | statusChanged(d->status); | - | ||||||||||||||||||
222 | } executed 126 times by 6 tests: end of block Executed by:
| 126 | ||||||||||||||||||
223 | - | |||||||||||||||||||
224 | static int thisRequestProgress = -1; | - | ||||||||||||||||||
225 | static int thisRequestFinished = -1; | - | ||||||||||||||||||
226 | if (thisRequestProgress == -1
| 12-114 | ||||||||||||||||||
227 | thisRequestProgress = | - | ||||||||||||||||||
228 | QQuickImageBase::staticMetaObject.indexOfSlot("requestProgress(qint64,qint64)"); | - | ||||||||||||||||||
229 | thisRequestFinished = | - | ||||||||||||||||||
230 | QQuickImageBase::staticMetaObject.indexOfSlot("requestFinished()"); | - | ||||||||||||||||||
231 | } executed 12 times by 6 tests: end of block Executed by:
| 12 | ||||||||||||||||||
232 | - | |||||||||||||||||||
233 | d->pix.connectFinished(this, thisRequestFinished); | - | ||||||||||||||||||
234 | d->pix.connectDownloadProgress(this, thisRequestProgress); | - | ||||||||||||||||||
235 | update(); | - | ||||||||||||||||||
236 | } executed 126 times by 6 tests: else {end of block Executed by:
| 126 | ||||||||||||||||||
237 | requestFinished(); | - | ||||||||||||||||||
238 | } executed 5318 times by 10 tests: end of block Executed by:
| 5318 | ||||||||||||||||||
239 | } | - | ||||||||||||||||||
240 | } | - | ||||||||||||||||||
241 | - | |||||||||||||||||||
242 | void QQuickImageBase::requestFinished() | - | ||||||||||||||||||
243 | { | - | ||||||||||||||||||
244 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
245 | - | |||||||||||||||||||
246 | if (d->pix.isError()
| 92-5314 | ||||||||||||||||||
247 | qmlWarning(this) << d->pix.error(); | - | ||||||||||||||||||
248 | d->pix.clear(this); | - | ||||||||||||||||||
249 | d->status = Error; | - | ||||||||||||||||||
250 | if (d->progress != 0.0
| 4-88 | ||||||||||||||||||
251 | d->progress = 0.0; | - | ||||||||||||||||||
252 | progressChanged(d->progress); | - | ||||||||||||||||||
253 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||
254 | } executed 92 times by 3 tests: else {end of block Executed by:
| 92 | ||||||||||||||||||
255 | d->status = Ready; | - | ||||||||||||||||||
256 | if (d->progress != 1.0
| 60-5254 | ||||||||||||||||||
257 | d->progress = 1.0; | - | ||||||||||||||||||
258 | progressChanged(d->progress); | - | ||||||||||||||||||
259 | } executed 5254 times by 10 tests: end of block Executed by:
| 5254 | ||||||||||||||||||
260 | } executed 5314 times by 10 tests: end of block Executed by:
| 5314 | ||||||||||||||||||
261 | pixmapChange(); | - | ||||||||||||||||||
262 | statusChanged(d->status); | - | ||||||||||||||||||
263 | if (sourceSize() != d->oldSourceSize
| 20-5386 | ||||||||||||||||||
264 | d->oldSourceSize = sourceSize(); | - | ||||||||||||||||||
265 | sourceSizeChanged(); | - | ||||||||||||||||||
266 | } executed 5386 times by 10 tests: end of block Executed by:
| 5386 | ||||||||||||||||||
267 | if (autoTransform() != d->oldAutoTransform
| 0-5406 | ||||||||||||||||||
268 | d->oldAutoTransform = autoTransform(); | - | ||||||||||||||||||
269 | emitAutoTransformBaseChanged(); | - | ||||||||||||||||||
270 | } never executed: end of block | 0 | ||||||||||||||||||
271 | update(); | - | ||||||||||||||||||
272 | } executed 5406 times by 10 tests: end of block Executed by:
| 5406 | ||||||||||||||||||
273 | - | |||||||||||||||||||
274 | void QQuickImageBase::requestProgress(qint64 received, qint64 total) | - | ||||||||||||||||||
275 | { | - | ||||||||||||||||||
276 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
277 | if (d->status == Loading
| 0-38 | ||||||||||||||||||
278 | d->progress = qreal(received)/total; | - | ||||||||||||||||||
279 | progressChanged(d->progress); | - | ||||||||||||||||||
280 | } executed 36 times by 3 tests: end of block Executed by:
| 36 | ||||||||||||||||||
281 | } executed 38 times by 3 tests: end of block Executed by:
| 38 | ||||||||||||||||||
282 | - | |||||||||||||||||||
283 | void QQuickImageBase::itemChange(ItemChange change, const ItemChangeData &value) | - | ||||||||||||||||||
284 | { | - | ||||||||||||||||||
285 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
286 | - | |||||||||||||||||||
287 | if (change == ItemDevicePixelRatioHasChanged
| 0-48482 | ||||||||||||||||||
288 | - | |||||||||||||||||||
289 | - | |||||||||||||||||||
290 | if (qmlEngine(this)
| 0 | ||||||||||||||||||
291 | load(); | - | ||||||||||||||||||
292 | } never executed: end of block | 0 | ||||||||||||||||||
293 | } never executed: end of block | 0 | ||||||||||||||||||
294 | QQuickItem::itemChange(change, value); | - | ||||||||||||||||||
295 | } executed 48482 times by 13 tests: end of block Executed by:
| 48482 | ||||||||||||||||||
296 | - | |||||||||||||||||||
297 | void QQuickImageBase::componentComplete() | - | ||||||||||||||||||
298 | { | - | ||||||||||||||||||
299 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
300 | QQuickItem::componentComplete(); | - | ||||||||||||||||||
301 | if (d->url.isValid()
| 44-5490 | ||||||||||||||||||
302 | load(); executed 5490 times by 12 tests: load(); Executed by:
| 5490 | ||||||||||||||||||
303 | } executed 5534 times by 14 tests: end of block Executed by:
| 5534 | ||||||||||||||||||
304 | - | |||||||||||||||||||
305 | void QQuickImageBase::pixmapChange() | - | ||||||||||||||||||
306 | { | - | ||||||||||||||||||
307 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
308 | setImplicitSize(d->pix.width() / d->devicePixelRatio, d->pix.height() / d->devicePixelRatio); | - | ||||||||||||||||||
309 | } executed 5980 times by 11 tests: end of block Executed by:
| 5980 | ||||||||||||||||||
310 | - | |||||||||||||||||||
311 | void QQuickImageBase::resolve2xLocalFile(const QUrl &url, qreal targetDevicePixelRatio, QUrl *sourceUrl, qreal *sourceDevicePixelRatio) | - | ||||||||||||||||||
312 | { | - | ||||||||||||||||||
313 | ((sourceUrl) ? static_cast<void>(0) : qt_assert("sourceUrl", __FILE__, 359)); | - | ||||||||||||||||||
314 | ((sourceDevicePixelRatio) ? static_cast<void>(0) : qt_assert("sourceDevicePixelRatio", __FILE__, 360)); | - | ||||||||||||||||||
315 | - | |||||||||||||||||||
316 | - | |||||||||||||||||||
317 | static const bool disable2xImageLoading = !qEnvironmentVariableIsEmpty("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING"); | - | ||||||||||||||||||
318 | if (disable2xImageLoading
| 0-5802 | ||||||||||||||||||
319 | return; never executed: return; | 0 | ||||||||||||||||||
320 | - | |||||||||||||||||||
321 | const QString localFile = QQmlFile::urlToLocalFileOrQrc(url); | - | ||||||||||||||||||
322 | - | |||||||||||||||||||
323 | - | |||||||||||||||||||
324 | if (localFile.isEmpty()
| 192-5610 | ||||||||||||||||||
325 | return; executed 192 times by 9 tests: return; Executed by:
| 192 | ||||||||||||||||||
326 | - | |||||||||||||||||||
327 | - | |||||||||||||||||||
328 | int atLocation = localFile.lastIndexOf(QLatin1Char('@')); | - | ||||||||||||||||||
329 | if (atLocation > 0
| 0-5590 | ||||||||||||||||||
330 | if (localFile[atLocation + 1].isDigit()
| 0-20 | ||||||||||||||||||
331 | && localFile[atLocation + 2] == QLatin1Char('x')
| 0-20 | ||||||||||||||||||
332 | && localFile[atLocation + 3] == QLatin1Char('.')
| 0-20 | ||||||||||||||||||
333 | *sourceDevicePixelRatio = localFile[atLocation + 1].digitValue(); | - | ||||||||||||||||||
334 | return; executed 20 times by 1 test: return; Executed by:
| 20 | ||||||||||||||||||
335 | } | - | ||||||||||||||||||
336 | } never executed: end of block | 0 | ||||||||||||||||||
337 | - | |||||||||||||||||||
338 | - | |||||||||||||||||||
339 | QString localFileX = qt_findAtNxFile(localFile, targetDevicePixelRatio, sourceDevicePixelRatio); | - | ||||||||||||||||||
340 | if (localFileX != localFile
| 0-5590 | ||||||||||||||||||
341 | * never executed: sourceUrl = QUrl::fromLocalFile(localFileX);*sourceUrl = QUrl::fromLocalFile(localFileX); never executed: *sourceUrl = QUrl::fromLocalFile(localFileX); | 0 | ||||||||||||||||||
342 | } executed 5590 times by 14 tests: end of block Executed by:
| 5590 | ||||||||||||||||||
343 | - | |||||||||||||||||||
344 | bool QQuickImageBase::autoTransform() const | - | ||||||||||||||||||
345 | { | - | ||||||||||||||||||
346 | const QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
347 | if (d->providerOptions.autoTransform() == QQuickImageProviderOptions::UsePluginDefaultTransform
| 0-5414 | ||||||||||||||||||
348 | return executed 5414 times by 10 tests: d->pix.autoTransform() == QQuickImageProviderOptions::ApplyTransform;return d->pix.autoTransform() == QQuickImageProviderOptions::ApplyTransform; Executed by:
executed 5414 times by 10 tests: return d->pix.autoTransform() == QQuickImageProviderOptions::ApplyTransform; Executed by:
| 5414 | ||||||||||||||||||
349 | return never executed: d->providerOptions.autoTransform() == QQuickImageProviderOptions::ApplyTransform;return d->providerOptions.autoTransform() == QQuickImageProviderOptions::ApplyTransform; never executed: return d->providerOptions.autoTransform() == QQuickImageProviderOptions::ApplyTransform; | 0 | ||||||||||||||||||
350 | } | - | ||||||||||||||||||
351 | - | |||||||||||||||||||
352 | void QQuickImageBase::setAutoTransform(bool transform) | - | ||||||||||||||||||
353 | { | - | ||||||||||||||||||
354 | QQuickImageBasePrivate * const d = d_func(); | - | ||||||||||||||||||
355 | if (d->providerOptions.autoTransform() != QQuickImageProviderOptions::UsePluginDefaultTransform
| 0 | ||||||||||||||||||
356 | transform == (d->providerOptions.autoTransform() == QQuickImageProviderOptions::ApplyTransform)
| 0 | ||||||||||||||||||
357 | return; never executed: return; | 0 | ||||||||||||||||||
358 | d->providerOptions.setAutoTransform(transform ? QQuickImageProviderOptions::ApplyTransform : QQuickImageProviderOptions::DoNotApplyTransform); | - | ||||||||||||||||||
359 | emitAutoTransformBaseChanged(); | - | ||||||||||||||||||
360 | } never executed: end of block | 0 | ||||||||||||||||||
361 | - | |||||||||||||||||||
362 | - | |||||||||||||||||||
363 | - | |||||||||||||||||||
Switch to Source code | Preprocessed file |