OpenCoverage

qquickimagebase.cpp

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

Generated by Squish Coco 4.2.0