OpenCoverage

qquickbehavior.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickbehavior.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qquickbehavior_p.h"-
41-
42#include "qquickanimation_p.h"-
43#include <qqmlcontext.h>-
44#include <qqmlinfo.h>-
45#include <private/qqmlproperty_p.h>-
46#include <private/qqmlengine_p.h>-
47#include <private/qabstractanimationjob_p.h>-
48#include <private/qquicktransition_p.h>-
49-
50#include <private/qquickanimatorjob_p.h>-
51-
52#include <private/qobject_p.h>-
53-
54QT_BEGIN_NAMESPACE-
55-
56class QQuickBehaviorPrivate : public QObjectPrivate, public QAnimationJobChangeListener-
57{-
58 Q_DECLARE_PUBLIC(QQuickBehavior)-
59public:-
60 QQuickBehaviorPrivate() : animation(nullptr), animationInstance(nullptr), enabled(true), finalized(false)-
61 , blockRunningChanged(false) {}
executed 560 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
560
62-
63 void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override;-
64-
65 QQmlProperty property;-
66 QVariant targetValue;-
67 QPointer<QQuickAbstractAnimation> animation;-
68 QAbstractAnimationJob *animationInstance;-
69 bool enabled;-
70 bool finalized;-
71 bool blockRunningChanged;-
72};-
73-
74/*!-
75 \qmltype Behavior-
76 \instantiates QQuickBehavior-
77 \inqmlmodule QtQuick-
78 \ingroup qtquick-transitions-animations-
79 \ingroup qtquick-interceptors-
80 \brief Defines a default animation for a property change.-
81-
82 A Behavior defines the default animation to be applied whenever a-
83 particular property value changes.-
84-
85 For example, the following Behavior defines a NumberAnimation to be run-
86 whenever the \l Rectangle's \c width value changes. When the MouseArea-
87 is clicked, the \c width is changed, triggering the behavior's animation:-
88-
89 \snippet qml/behavior.qml 0-
90-
91 Note that a property cannot have more than one assigned Behavior. To provide-
92 multiple animations within a Behavior, use ParallelAnimation or-
93 SequentialAnimation.-
94-
95 If a \l{Qt Quick States}{state change} has a \l Transition that matches the same property as a-
96 Behavior, the \l Transition animation overrides the Behavior for that-
97 state change. For general advice on using Behaviors to animate state changes, see-
98 \l{Using Qt Quick Behaviors with States}.-
99-
100 \sa {Animation and Transitions in Qt Quick}, {Qt Quick Examples - Animation#Behaviors}{Behavior example}, {Qt QML}-
101*/-
102-
103-
104QQuickBehavior::QQuickBehavior(QObject *parent)-
105 : QObject(*(new QQuickBehaviorPrivate), parent)-
106{-
107}
executed 560 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
560
108-
109QQuickBehavior::~QQuickBehavior()-
110{-
111 Q_D(QQuickBehavior);-
112 delete d->animationInstance;-
113}
executed 558 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
558
114-
115/*!-
116 \qmlproperty Animation QtQuick::Behavior::animation-
117 \default-
118-
119 This property holds the animation to run when the behavior is triggered.-
120*/-
121-
122QQuickAbstractAnimation *QQuickBehavior::animation()-
123{-
124 Q_D(QQuickBehavior);-
125 return d->animation;
executed 10 times by 1 test: return d->animation;
Executed by:
  • tst_qquickbehaviors
10
126}-
127-
128void QQuickBehavior::setAnimation(QQuickAbstractAnimation *animation)-
129{-
130 Q_D(QQuickBehavior);-
131 if (d->animation) {
d->animationDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickbehaviors
FALSEevaluated 194 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
2-194
132 qmlWarning(this) << tr("Cannot change the animation assigned to a Behavior.");-
133 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickbehaviors
2
134 }-
135-
136 d->animation = animation;-
137 if (d->animation) {
d->animationDescription
TRUEevaluated 194 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-194
138 d->animation->setDefaultTarget(d->property);-
139 d->animation->setDisableUserControl();-
140 }
executed 194 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
194
141}
executed 194 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
194
142-
143-
144void QQuickBehaviorPrivate::animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState,QAbstractAnimationJob::State)-
145{-
146 if (!blockRunningChanged)
!blockRunningChangedDescription
TRUEevaluated 444 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-444
147 animation->notifyRunningChanged(newState == QAbstractAnimationJob::Running);
executed 444 times by 7 tests: animation->notifyRunningChanged(newState == QAbstractAnimationJob::Running);
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
444
148}
executed 444 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
444
149-
150/*!-
151 \qmlproperty bool QtQuick::Behavior::enabled-
152-
153 This property holds whether the behavior will be triggered when the tracked-
154 property changes value.-
155-
156 By default a Behavior is enabled.-
157*/-
158-
159bool QQuickBehavior::enabled() const-
160{-
161 Q_D(const QQuickBehavior);-
162 return d->enabled;
executed 6 times by 1 test: return d->enabled;
Executed by:
  • tst_qquickbehaviors
6
163}-
164-
165void QQuickBehavior::setEnabled(bool enabled)-
166{-
167 Q_D(QQuickBehavior);-
168 if (d->enabled == enabled)
d->enabled == enabledDescription
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
34-42
169 return;
executed 34 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquicklistview
34
170 d->enabled = enabled;-
171 emit enabledChanged();-
172}
executed 42 times by 2 tests: end of block
Executed by:
  • tst_qquickbehaviors
  • tst_qquicklistview
42
173-
174void QQuickBehavior::write(const QVariant &value)-
175{-
176 Q_D(QQuickBehavior);-
177 bool bypass = !d->enabled || !d->finalized || QQmlEnginePrivate::designerMode();
!d->enabledDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
FALSEevaluated 280 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
!d->finalizedDescription
TRUEevaluated 22 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
  • tst_qquickloader
FALSEevaluated 258 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
QQmlEnginePriv...designerMode()Description
TRUEnever evaluated
FALSEevaluated 258 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
0-280
178 if (!bypass)
!bypassDescription
TRUEevaluated 258 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEevaluated 30 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
30-258
179 qmlExecuteDeferred(this);
executed 258 times by 7 tests: qmlExecuteDeferred(this);
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
258
180 if (!d->animation || bypass) {
!d->animationDescription
TRUEevaluated 28 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
FALSEevaluated 260 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
bypassDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickbehaviors
FALSEevaluated 256 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
4-260
181 if (d->animationInstance)
d->animationInstanceDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickbehaviors
FALSEevaluated 28 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
4-28
182 d->animationInstance->stop();
executed 4 times by 1 test: d->animationInstance->stop();
Executed by:
  • tst_qquickbehaviors
4
183 QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding);-
184 d->targetValue = value;-
185 return;
executed 32 times by 5 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
32
186 }-
187-
188 bool behaviorActive = d->animation->isRunning();-
189 if (behaviorActive && value == d->targetValue)
behaviorActiveDescription
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
FALSEevaluated 204 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
value == d->targetValueDescription
TRUEnever evaluated
FALSEevaluated 52 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
0-204
190 return;
never executed: return;
0
191-
192 d->targetValue = value;-
193-
194 if (d->animationInstance
d->animationInstanceDescription
TRUEevaluated 68 times by 3 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
FALSEevaluated 188 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
68-188
195 && (d->animationInstance->duration() != -1
d->animationIn...ration() != -1Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
FALSEevaluated 54 times by 3 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
14-54
196 || d->animationInstance->isRenderThreadProxy())
d->animationIn...rThreadProxy()Description
TRUEnever evaluated
FALSEevaluated 54 times by 3 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
0-54
197 && !d->animationInstance->isStopped()) {
!d->animationI...e->isStopped()Description
TRUEnever evaluated
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
0-14
198 d->blockRunningChanged = true;-
199 d->animationInstance->stop();-
200 }
never executed: end of block
0
201 // Render thread animations use "stop" to synchronize the property back-
202 // to the item, so we need to read the value after.-
203 const QVariant &currentValue = d->property.read();-
204-
205 // Don't unnecessarily wake up the animation system if no real animation-
206 // is needed (value has not changed). If the Behavior was already-
207 // running, let it continue as normal to ensure correct behavior and state.-
208 if (!behaviorActive && d->targetValue == currentValue) {
!behaviorActiveDescription
TRUEevaluated 204 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEevaluated 52 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
d->targetValue == currentValueDescription
TRUEevaluated 34 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
FALSEevaluated 170 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
34-204
209 QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding);-
210 return;
executed 34 times by 3 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
34
211 }-
212-
213 QQuickStateOperation::ActionList actions;-
214 QQuickStateAction action;-
215 action.property = d->property;-
216 action.fromValue = currentValue;-
217 action.toValue = value;-
218 actions << action;-
219-
220 QList<QQmlProperty> after;-
221 QAbstractAnimationJob *prev = d->animationInstance;-
222 d->animationInstance = d->animation->transition(actions, after, QQuickAbstractAnimation::Forward);-
223-
224 if (d->animationInstance && d->animation->threadingModel() == QQuickAbstractAnimation::RenderThread)
d->animationInstanceDescription
TRUEevaluated 222 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEnever evaluated
d->animation->...::RenderThreadDescription
TRUEnever evaluated
FALSEevaluated 222 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
0-222
225 d->animationInstance = new QQuickAnimatorProxyJob(d->animationInstance, d->animation);
never executed: d->animationInstance = new QQuickAnimatorProxyJob(d->animationInstance, d->animation);
0
226-
227 if (prev && prev != d->animationInstance)
prevDescription
TRUEevaluated 64 times by 3 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
FALSEevaluated 158 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
prev != d->animationInstanceDescription
TRUEevaluated 64 times by 3 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-158
228 delete prev;
executed 64 times by 3 tests: delete prev;
Executed by:
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
64
229-
230 if (d->animationInstance) {
d->animationInstanceDescription
TRUEevaluated 222 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-222
231 if (d->animationInstance != prev)
d->animationInstance != prevDescription
TRUEevaluated 222 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-222
232 d->animationInstance->addAnimationChangeListener(d, QAbstractAnimationJob::StateChange);
executed 222 times by 7 tests: d->animationInstance->addAnimationChangeListener(d, QAbstractAnimationJob::StateChange);
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
222
233 d->animationInstance->start();-
234 d->blockRunningChanged = false;-
235 }
executed 222 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
222
236 if (!after.contains(d->property))
!after.contains(d->property)Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquickloader
FALSEevaluated 212 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
10-212
237 QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding);
executed 10 times by 2 tests: QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding);
Executed by:
  • tst_qquickbehaviors
  • tst_qquickloader
10
238}
executed 222 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
222
239-
240void QQuickBehavior::setTarget(const QQmlProperty &property)-
241{-
242 Q_D(QQuickBehavior);-
243 d->property = property;-
244 if (d->animation)
d->animationDescription
TRUEevaluated 24 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
FALSEevaluated 534 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
24-534
245 d->animation->setDefaultTarget(property);
executed 24 times by 4 tests: d->animation->setDefaultTarget(property);
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
24
246-
247 QQmlEnginePrivate *engPriv = QQmlEnginePrivate::get(qmlEngine(this));-
248 static int finalizedIdx = -1;-
249 if (finalizedIdx < 0)
finalizedIdx < 0Description
TRUEevaluated 14 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
FALSEevaluated 544 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
14-544
250 finalizedIdx = metaObject()->indexOfSlot("componentFinalized()");
executed 14 times by 7 tests: finalizedIdx = metaObject()->indexOfSlot("componentFinalized()");
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
14
251 engPriv->registerFinalizeCallback(this, finalizedIdx);-
252}
executed 558 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
558
253-
254void QQuickBehavior::componentFinalized()-
255{-
256 Q_D(QQuickBehavior);-
257 d->finalized = true;-
258}
executed 558 times by 7 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimatedimage
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquickloader
  • tst_qquicksmoothedanimation
558
259-
260QT_END_NAMESPACE-
261-
262#include "moc_qquickbehavior_p.cpp"-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0