OpenCoverage

qquickanimatedimage.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickanimatedimage.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7QQuickPixmap* QQuickAnimatedImagePrivate::infoForCurrentFrame(QQmlEngine *engine)-
8{-
9 if (!movie
!movieDescription
TRUEnever evaluated
FALSEevaluated 404 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
0-404
10 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
11-
12 int current = movie->currentFrameNumber();-
13 if (!frameMap.contains(current)
!frameMap.contains(current)Description
TRUEevaluated 232 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
172-232
14 QUrl requestedUrl;-
15 QQuickPixmap *pixmap = nullptr;-
16 if (engine
engineDescription
TRUEevaluated 232 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
&& !movie->fileName().isEmpty()
!movie->fileName().isEmpty()Description
TRUEevaluated 220 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
0-232
17 requestedUrl.setUrl(QString::fromUtf8("quickanimatedimage://%1#%2")-
18 .arg(movie->fileName())-
19 .arg(current));-
20 }
executed 220 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
220
21 if (!requestedUrl.isEmpty()
!requestedUrl.isEmpty()Description
TRUEevaluated 220 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
12-220
22 if (QQuickPixmap::isCached(requestedUrl, QSize(), QQuickImageProviderOptions())
QQuickPixmap::...iderOptions())Description
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
56-164
23 pixmap = new QQuickPixmap(engine, requestedUrl);
executed 164 times by 1 test: pixmap = new QQuickPixmap(engine, requestedUrl);
Executed by:
  • tst_qquickanimatedimage
164
24 else-
25 pixmap = new QQuickPixmap(requestedUrl, movie->currentImage());
executed 56 times by 1 test: pixmap = new QQuickPixmap(requestedUrl, movie->currentImage());
Executed by:
  • tst_qquickanimatedimage
56
26 } else {-
27 pixmap = new QQuickPixmap;-
28 pixmap->setImage(movie->currentImage());-
29 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
12
30 frameMap.insert(current, pixmap);-
31 }
executed 232 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
232
32-
33 return
executed 404 times by 1 test: return frameMap.value(current);
Executed by:
  • tst_qquickanimatedimage
frameMap.value(current);
executed 404 times by 1 test: return frameMap.value(current);
Executed by:
  • tst_qquickanimatedimage
404
34}-
35QQuickAnimatedImage::QQuickAnimatedImage(QQuickItem *parent)-
36 : QQuickImage(*(new QQuickAnimatedImagePrivate), parent)-
37{-
38 connect(this, &QQuickImageBase::cacheChanged, this, &QQuickAnimatedImage::onCacheChanged);-
39}
executed 90 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
90
40-
41QQuickAnimatedImage::~QQuickAnimatedImage()-
42{-
43 QQuickAnimatedImagePrivate * const d = d_func();-
44-
45 if (d->reply
d->replyDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 84 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
6-84
46 d->reply->deleteLater();
executed 6 times by 1 test: d->reply->deleteLater();
Executed by:
  • tst_qquickanimatedimage
6
47-
48 delete d->movie;-
49 qDeleteAll(d->frameMap);-
50 d->frameMap.clear();-
51}
executed 90 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
90
52bool QQuickAnimatedImage::isPaused() const-
53{-
54 const QQuickAnimatedImagePrivate * const d = d_func();-
55 if (!d->movie
!d->movieDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
42-48
56 return
executed 42 times by 1 test: return d->paused;
Executed by:
  • tst_qquickanimatedimage
d->paused;
executed 42 times by 1 test: return d->paused;
Executed by:
  • tst_qquickanimatedimage
42
57 return
executed 48 times by 1 test: return d->movie->state()==QMovie::Paused;
Executed by:
  • tst_qquickanimatedimage
d->movie->state()==QMovie::Paused;
executed 48 times by 1 test: return d->movie->state()==QMovie::Paused;
Executed by:
  • tst_qquickanimatedimage
48
58}-
59-
60void QQuickAnimatedImage::setPaused(bool pause)-
61{-
62 QQuickAnimatedImagePrivate * const d = d_func();-
63 if (pause == d->paused
pause == d->pausedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
2-14
64 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickanimatedimage
2
65 if (!d->movie
!d->movieDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
2-12
66 d->paused = pause;-
67 pausedChanged();-
68 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
else {
12
69 d->movie->setPaused(pause);-
70 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
2
71}-
72bool QQuickAnimatedImage::isPlaying() const-
73{-
74 const QQuickAnimatedImagePrivate * const d = d_func();-
75 if (!d->movie
!d->movieDescription
TRUEevaluated 164 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 338 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
164-338
76 return
executed 164 times by 2 tests: return d->playing;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
d->playing;
executed 164 times by 2 tests: return d->playing;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
164
77 return
executed 338 times by 1 test: return d->movie->state()!=QMovie::NotRunning;
Executed by:
  • tst_qquickanimatedimage
d->movie->state()!=QMovie::NotRunning;
executed 338 times by 1 test: return d->movie->state()!=QMovie::NotRunning;
Executed by:
  • tst_qquickanimatedimage
338
78}-
79-
80void QQuickAnimatedImage::setPlaying(bool play)-
81{-
82 QQuickAnimatedImagePrivate * const d = d_func();-
83 if (play == d->playing
play == d->playingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
2-16
84 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickanimatedimage
2
85 if (!d->movie
!d->movieDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
6-10
86 d->playing = play;-
87 playingChanged();-
88 return;
executed 10 times by 1 test: return;
Executed by:
  • tst_qquickanimatedimage
10
89 }-
90 if (play
playDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
2-4
91 d->movie->start();
executed 4 times by 1 test: d->movie->start();
Executed by:
  • tst_qquickanimatedimage
4
92 else-
93 d->movie->stop();
executed 2 times by 1 test: d->movie->stop();
Executed by:
  • tst_qquickanimatedimage
2
94}-
95int QQuickAnimatedImage::currentFrame() const-
96{-
97 const QQuickAnimatedImagePrivate * const d = d_func();-
98 if (!d->movie
!d->movieDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
8-22
99 return
executed 8 times by 2 tests: return d->presetCurrentFrame;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
d->presetCurrentFrame;
executed 8 times by 2 tests: return d->presetCurrentFrame;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
8
100 return
executed 22 times by 2 tests: return d->movie->currentFrameNumber();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
d->movie->currentFrameNumber();
executed 22 times by 2 tests: return d->movie->currentFrameNumber();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
22
101}-
102-
103void QQuickAnimatedImage::setCurrentFrame(int frame)-
104{-
105 QQuickAnimatedImagePrivate * const d = d_func();-
106 if (!d->movie
!d->movieDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
8-40
107 d->presetCurrentFrame = frame;-
108 return;
executed 8 times by 1 test: return;
Executed by:
  • tst_qquickanimatedimage
8
109 }-
110 d->movie->jumpToFrame(frame);-
111}
executed 40 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
40
112-
113int QQuickAnimatedImage::frameCount() const-
114{-
115 const QQuickAnimatedImagePrivate * const d = d_func();-
116 if (!d->movie
!d->movieDescription
TRUEevaluated 242 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 270 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
242-270
117 return
executed 242 times by 2 tests: return 0;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
0;
executed 242 times by 2 tests: return 0;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
242
118 return
executed 270 times by 2 tests: return d->movie->frameCount();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
d->movie->frameCount();
executed 270 times by 2 tests: return d->movie->frameCount();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
270
119}-
120qreal QQuickAnimatedImage::speed() const-
121{-
122 const QQuickAnimatedImagePrivate * const d = d_func();-
123 return
never executed: return d->speed;
d->speed;
never executed: return d->speed;
0
124}-
125-
126void QQuickAnimatedImage::setSpeed(qreal speed)-
127{-
128 QQuickAnimatedImagePrivate * const d = d_func();-
129 if (d->speed != speed
d->speed != speedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
130 d->speed = speed;-
131 if (d->movie
d->movieDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
132 d->movie->setSpeed(qRound(speed * 100.0));
never executed: d->movie->setSpeed(qRound(speed * 100.0));
0
133 speedChanged();-
134 }
never executed: end of block
0
135}
never executed: end of block
0
136-
137void QQuickAnimatedImage::setSource(const QUrl &url)-
138{-
139 QQuickAnimatedImagePrivate * const d = d_func();-
140 if (url == d->url
url == d->urlDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 168 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
64-168
141 return;
executed 64 times by 1 test: return;
Executed by:
  • tst_qquickanimatedimage
64
142-
143-
144 if (d->reply
d->replyDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 160 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
) {
8-160
145 d->reply->deleteLater();-
146 d->reply = nullptr;-
147 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
8
148-
149-
150 d->setImage(QImage());-
151 qDeleteAll(d->frameMap);-
152 d->frameMap.clear();-
153-
154 d->oldPlaying = isPlaying();-
155 d->setMovie(nullptr);-
156 d->url = url;-
157 sourceChanged(d->url);-
158-
159 if (isComponentComplete()
isComponentComplete()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 82 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
82-86
160 load();
executed 86 times by 1 test: load();
Executed by:
  • tst_qquickanimatedimage
86
161}
executed 168 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
168
162-
163void QQuickAnimatedImage::load()-
164{-
165 QQuickAnimatedImagePrivate * const d = d_func();-
166-
167 if (d->url.isEmpty()
d->url.isEmpty()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 160 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
) {
16-160
168 if (d->progress != 0
d->progress != 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
8
169 d->progress = 0;-
170 progressChanged(d->progress);-
171 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
8
172-
173 d->setImage(QImage());-
174 d->status = Null;-
175 statusChanged(d->status);-
176-
177 d->currentSourceSize = QSize(0, 0);-
178 if (d->currentSourceSize != d->oldSourceSize
d->currentSour...>oldSourceSizeDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
) {
0-16
179 d->oldSourceSize = d->currentSourceSize;-
180 sourceSizeChanged();-
181 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
16
182 if (isPlaying() != d->oldPlaying
isPlaying() != d->oldPlayingDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
8
183 playingChanged();
executed 8 times by 1 test: playingChanged();
Executed by:
  • tst_qquickanimatedimage
8
184 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
else {
16
185 const qreal targetDevicePixelRatio = (window()
window()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 158 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
? window()->effectiveDevicePixelRatio() : (static_cast<QGuiApplication *>(QCoreApplication::instance()))->devicePixelRatio());
2-158
186 d->devicePixelRatio = 1.0;-
187-
188 QUrl loadUrl = d->url;-
189 resolve2xLocalFile(d->url, targetDevicePixelRatio, &loadUrl, &d->devicePixelRatio);-
190 QString lf = QQmlFile::urlToLocalFileOrQrc(loadUrl);-
191-
192 if (!lf.isEmpty()
!lf.isEmpty()Description
TRUEevaluated 146 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
14-146
193 d->setMovie(new QMovie(lf));-
194 movieRequestFinished();-
195 }
executed 146 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
else {
146
196-
197 if (d->status != Loading
d->status != LoadingDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
) {
0-14
198 d->status = Loading;-
199 statusChanged(d->status);-
200 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
14
201 if (d->progress != 0
d->progress != 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
6-8
202 d->progress = 0;-
203 progressChanged(d->progress);-
204 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
6
205 QNetworkRequest req(d->url);-
206 req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);-
207-
208 d->reply = qmlEngine(this)->networkAccessManager()->get(req);-
209 connect(d->reply, &QNetworkReply::finished, this, &QQuickAnimatedImage::movieRequestFinished);-
210 connect(d->reply, qFlagLocation("2""downloadProgress(qint64,qint64)" "\0" __FILE__ ":" "362"), this, qFlagLocation("1""requestProgress(qint64,qint64)" "\0" __FILE__ ":" "362"));-
211-
212 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
14
213 }-
214}-
215-
216-
217-
218void QQuickAnimatedImage::movieRequestFinished()-
219{-
220-
221 QQuickAnimatedImagePrivate * const d = d_func();-
222-
223-
224 if (d->reply
d->replyDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 146 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
) {
10-146
225 d->redirectCount++;-
226 if (d->redirectCount < 16
d->redirectCount < 16Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
) {
0-10
227 QVariant redirect = d->reply->attribute(QNetworkRequest::RedirectionTargetAttribute);-
228 if (redirect.isValid()
redirect.isValid()Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
0-10
229 QUrl url = d->reply->url().resolved(redirect.toUrl());-
230 d->reply->deleteLater();-
231 setSource(url);-
232 return;
never executed: return;
0
233 }-
234 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
10
235-
236 d->redirectCount=0;-
237 d->setMovie(new QMovie(d->reply));-
238 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
10
239-
240-
241 if (!d->movie
!d->movieDescription
TRUEnever evaluated
FALSEevaluated 156 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
|| !d->movie->isValid()
!d->movie->isValid()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
0-156
242 qmlWarning(this) << "Error Reading Animated Image File " << d->url.toString();-
243 d->setMovie(nullptr);-
244 d->setImage(QImage());-
245 if (d->progress != 0
d->progress != 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
) {
0-4
246 d->progress = 0;-
247 progressChanged(d->progress);-
248 }
never executed: end of block
0
249 d->status = Error;-
250 statusChanged(d->status);-
251-
252 d->currentSourceSize = QSize(0, 0);-
253 if (d->currentSourceSize != d->oldSourceSize
d->currentSour...>oldSourceSizeDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEnever evaluated
) {
0-4
254 d->oldSourceSize = d->currentSourceSize;-
255 sourceSizeChanged();-
256 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
4
257 if (isPlaying() != d->oldPlaying
isPlaying() != d->oldPlayingDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
0-4
258 playingChanged();
never executed: playingChanged();
0
259 return;
executed 4 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
4
260 }-
261-
262 connect(d->movie, &QMovie::stateChanged, this, &QQuickAnimatedImage::playingStatusChanged);-
263 connect(d->movie, &QMovie::frameChanged, this, &QQuickAnimatedImage::movieUpdate);-
264 if (d->cache
d->cacheDescription
TRUEevaluated 150 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
2-150
265 d->movie->setCacheMode(QMovie::CacheAll);
executed 150 times by 1 test: d->movie->setCacheMode(QMovie::CacheAll);
Executed by:
  • tst_qquickanimatedimage
150
266 d->movie->setSpeed(qRound(d->speed * 100.0));-
267-
268 d->status = Ready;-
269 statusChanged(d->status);-
270-
271 if (d->progress != 1.0
d->progress != 1.0Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
70-82
272 d->progress = 1.0;-
273 progressChanged(d->progress);-
274 }
executed 82 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
82
275-
276 bool pausedAtStart = d->paused;-
277 if (d->movie
d->movieDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
&& d->playing
d->playingDescription
TRUEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
0-152
278 d->movie->start();
executed 146 times by 1 test: d->movie->start();
Executed by:
  • tst_qquickanimatedimage
146
279 if (d->movie
d->movieDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
&& pausedAtStart
pausedAtStartDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
0-152
280 d->movie->setPaused(true);
executed 6 times by 1 test: d->movie->setPaused(true);
Executed by:
  • tst_qquickanimatedimage
6
281 if (d->movie
d->movieDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
&& (d->paused
d->pausedDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
|| !d->playing
!d->playingDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)) {
0-152
282 d->movie->jumpToFrame(d->presetCurrentFrame);-
283 d->presetCurrentFrame = 0;-
284 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
12
285-
286 QQuickPixmap *pixmap = d->infoForCurrentFrame(qmlEngine(this));-
287 if (pixmap
pixmapDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
)
0-152
288 d->setPixmap(*pixmap);
executed 152 times by 1 test: d->setPixmap(*pixmap);
Executed by:
  • tst_qquickanimatedimage
152
289-
290 if (isPlaying() != d->oldPlaying
isPlaying() != d->oldPlayingDescription
TRUEnever evaluated
FALSEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
0-152
291 playingChanged();
never executed: playingChanged();
0
292-
293 if (d->movie
d->movieDescription
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
)
0-152
294 d->currentSourceSize = d->movie->currentPixmap().size();
executed 152 times by 1 test: d->currentSourceSize = d->movie->currentPixmap().size();
Executed by:
  • tst_qquickanimatedimage
152
295 else-
296 d->currentSourceSize = QSize(0, 0);
never executed: d->currentSourceSize = QSize(0, 0);
0
297-
298 if (d->currentSourceSize != d->oldSourceSize
d->currentSour...>oldSourceSizeDescription
TRUEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
6-146
299 d->oldSourceSize = d->currentSourceSize;-
300 sourceSizeChanged();-
301 }
executed 146 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
146
302}
executed 152 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
152
303-
304void QQuickAnimatedImage::movieUpdate()-
305{-
306 QQuickAnimatedImagePrivate * const d = d_func();-
307-
308 if (!d->cache
!d->cacheDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 234 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
18-234
309 qDeleteAll(d->frameMap);-
310 d->frameMap.clear();-
311 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
18
312-
313 if (d->movie
d->movieDescription
TRUEevaluated 252 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
) {
0-252
314 d->setPixmap(*d->infoForCurrentFrame(qmlEngine(this)));-
315 frameChanged();-
316 }
executed 252 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
252
317}
executed 252 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
252
318-
319void QQuickAnimatedImage::playingStatusChanged()-
320{-
321 QQuickAnimatedImagePrivate * const d = d_func();-
322-
323 if ((
(d->movie->sta... != d->playingDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
d->movie->state() != QMovie::NotRunning) != d->playing
(d->movie->sta... != d->playingDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
8-154
324 d->playing = (d->movie->state() != QMovie::NotRunning);-
325 playingChanged();-
326 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
8
327 if ((
(d->movie->sta...) != d->pausedDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
d->movie->state() == QMovie::Paused) != d->paused
(d->movie->sta...) != d->pausedDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEevaluated 146 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
) {
16-146
328 d->paused = (d->movie->state() == QMovie::Paused);-
329 pausedChanged();-
330 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
16
331}
executed 162 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
162
332-
333void QQuickAnimatedImage::onCacheChanged()-
334{-
335 QQuickAnimatedImagePrivate * const d = d_func();-
336 if (!cache()
!cache()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
FALSEnever evaluated
) {
0-2
337 qDeleteAll(d->frameMap);-
338 d->frameMap.clear();-
339 if (d->movie
d->movieDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
0-2
340 d->movie->setCacheMode(QMovie::CacheNone);
never executed: d->movie->setCacheMode(QMovie::CacheNone);
0
341 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimatedimage
else {
2
342 if (d->movie
d->movieDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
343 d->movie->setCacheMode(QMovie::CacheAll);
never executed: d->movie->setCacheMode(QMovie::CacheAll);
0
344 }
never executed: end of block
0
345}-
346-
347QSize QQuickAnimatedImage::sourceSize()-
348{-
349 QQuickAnimatedImagePrivate * const d = d_func();-
350 return
executed 24 times by 1 test: return d->currentSourceSize;
Executed by:
  • tst_qquickanimatedimage
d->currentSourceSize;
executed 24 times by 1 test: return d->currentSourceSize;
Executed by:
  • tst_qquickanimatedimage
24
351}-
352-
353void QQuickAnimatedImage::componentComplete()-
354{-
355 QQuickItem::componentComplete();-
356 load();-
357}
executed 90 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
90
358-
359void QQuickAnimatedImagePrivate::setMovie(QMovie *m)-
360{-
361 if (movie == m
movie == mDescription
TRUEevaluated 94 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 234 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
)
94-234
362 return;
executed 94 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
94
363 QQuickAnimatedImage * const q = q_func();-
364 const int oldFrameCount = q->frameCount();-
365-
366 if (movie
movieDescription
TRUEevaluated 78 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 156 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
) {
78-156
367 movie->disconnect();-
368 movie->deleteLater();-
369 }
executed 78 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
78
370 movie = m;-
371-
372 if (oldFrameCount != q->frameCount()
oldFrameCount ...->frameCount()Description
TRUEevaluated 216 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qquickanimatedimage
)
18-216
373 q->frameCountChanged();
executed 216 times by 2 tests: q->frameCountChanged();
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
216
374}
executed 234 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
234
375-
376-
377-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0