| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | class QQuickBehaviorPrivate : public QObjectPrivate, public QAnimationJobChangeListener | - |
| 8 | { | - |
| 9 | inline QQuickBehavior* q_func() { return static_cast<QQuickBehavior *>(q_ptr); } inline const QQuickBehavior* q_func() const { return static_cast<const QQuickBehavior *>(q_ptr); } friend class QQuickBehavior; | - |
| 10 | public: | - |
| 11 | QQuickBehaviorPrivate() : animation(nullptr), animationInstance(nullptr), enabled(true), finalized(false) | - |
| 12 | , blockRunningChanged(false) {}executed 560 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 560 |
| 13 | | - |
| 14 | void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override; | - |
| 15 | | - |
| 16 | QQmlProperty property; | - |
| 17 | QVariant targetValue; | - |
| 18 | QPointer<QQuickAbstractAnimation> animation; | - |
| 19 | QAbstractAnimationJob *animationInstance; | - |
| 20 | bool enabled; | - |
| 21 | bool finalized; | - |
| 22 | bool blockRunningChanged; | - |
| 23 | }; | - |
| 24 | QQuickBehavior::QQuickBehavior(QObject *parent) | - |
| 25 | : QObject(*(new QQuickBehaviorPrivate), parent) | - |
| 26 | { | - |
| 27 | }executed 560 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 560 |
| 28 | | - |
| 29 | QQuickBehavior::~QQuickBehavior() | - |
| 30 | { | - |
| 31 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 32 | delete d->animationInstance; | - |
| 33 | }executed 558 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 558 |
| 34 | QQuickAbstractAnimation *QQuickBehavior::animation() | - |
| 35 | { | - |
| 36 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 37 | returnexecuted 10 times by 1 test: return d->animation; d->animation;executed 10 times by 1 test: return d->animation; | 10 |
| 38 | } | - |
| 39 | | - |
| 40 | void QQuickBehavior::setAnimation(QQuickAbstractAnimation *animation) | - |
| 41 | { | - |
| 42 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 43 | if (d->animation| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 194 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
) { | 2-194 |
| 44 | qmlWarning(this) << tr("Cannot change the animation assigned to a Behavior."); | - |
| 45 | return;executed 2 times by 1 test: return; | 2 |
| 46 | } | - |
| 47 | | - |
| 48 | d->animation = animation; | - |
| 49 | if (d->animation| TRUE | evaluated 194 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | never evaluated |
) { | 0-194 |
| 50 | d->animation->setDefaultTarget(d->property); | - |
| 51 | d->animation->setDisableUserControl(); | - |
| 52 | }executed 194 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 194 |
| 53 | }executed 194 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 194 |
| 54 | | - |
| 55 | | - |
| 56 | void QQuickBehaviorPrivate::animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState,QAbstractAnimationJob::State) | - |
| 57 | { | - |
| 58 | if (!blockRunningChanged| TRUE | evaluated 444 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | never evaluated |
) | 0-444 |
| 59 | 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 |
| 60 | }executed 444 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 444 |
| 61 | bool QQuickBehavior::enabled() const | - |
| 62 | { | - |
| 63 | const QQuickBehaviorPrivate * const d = d_func(); | - |
| 64 | returnexecuted 6 times by 1 test: return d->enabled; d->enabled;executed 6 times by 1 test: return d->enabled; | 6 |
| 65 | } | - |
| 66 | | - |
| 67 | void QQuickBehavior::setEnabled(bool enabled) | - |
| 68 | { | - |
| 69 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 70 | if (d->enabled == enabled| TRUE | evaluated 34 times by 2 testsEvaluated by:- tst_examples
- tst_qquicklistview
| | FALSE | evaluated 42 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
|
) | 34-42 |
| 71 | return;executed 34 times by 2 tests: return;Executed by:- tst_examples
- tst_qquicklistview
| 34 |
| 72 | d->enabled = enabled; | - |
| 73 | enabledChanged(); | - |
| 74 | }executed 42 times by 2 tests: end of blockExecuted by:- tst_qquickbehaviors
- tst_qquicklistview
| 42 |
| 75 | | - |
| 76 | void QQuickBehavior::write(const QVariant &value) | - |
| 77 | { | - |
| 78 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 79 | bool bypass = !d->enabled| TRUE | evaluated 8 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
| | FALSE | evaluated 280 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
|| !d->finalized| TRUE | evaluated 22 times by 4 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
- tst_qquickloader
| | FALSE | evaluated 258 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
|| QQmlEnginePrivate::designerMode()| TRUE | never evaluated | | FALSE | evaluated 258 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
; | 0-280 |
| 80 | if (!bypass| TRUE | evaluated 258 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | evaluated 30 times by 5 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
|
) | 30-258 |
| 81 | 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 |
| 82 | if (!d->animation| TRUE | evaluated 28 times by 5 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
| | FALSE | evaluated 260 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
|| bypass| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 256 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
) { | 4-260 |
| 83 | if (d->animationInstance| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 28 times by 5 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
|
) | 4-28 |
| 84 | d->animationInstance->stop();executed 4 times by 1 test: d->animationInstance->stop(); | 4 |
| 85 | QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding); | - |
| 86 | d->targetValue = value; | - |
| 87 | return;executed 32 times by 5 tests: return;Executed by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
| 32 |
| 88 | } | - |
| 89 | | - |
| 90 | bool behaviorActive = d->animation->isRunning(); | - |
| 91 | if (behaviorActive| TRUE | evaluated 52 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicksmoothedanimation
| | FALSE | evaluated 204 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
&& value == d->targetValue| TRUE | never evaluated | | FALSE | evaluated 52 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicksmoothedanimation
|
) | 0-204 |
| 92 | return; never executed: return; | 0 |
| 93 | | - |
| 94 | d->targetValue = value; | - |
| 95 | | - |
| 96 | if (d->animationInstance| TRUE | evaluated 68 times by 3 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
| | FALSE | evaluated 188 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
| 68-188 |
| 97 | && (d->animationInstance->duration() != -1| TRUE | evaluated 14 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
| | FALSE | evaluated 54 times by 3 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
|
| 14-54 |
| 98 | || d->animationInstance->isRenderThreadProxy()| TRUE | never evaluated | | FALSE | evaluated 54 times by 3 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
|
) | 0-54 |
| 99 | && !d->animationInstance->isStopped()| TRUE | never evaluated | | FALSE | evaluated 14 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
|
) { | 0-14 |
| 100 | d->blockRunningChanged = true; | - |
| 101 | d->animationInstance->stop(); | - |
| 102 | } never executed: end of block | 0 |
| 103 | | - |
| 104 | | - |
| 105 | const QVariant ¤tValue = d->property.read(); | - |
| 106 | | - |
| 107 | | - |
| 108 | | - |
| 109 | | - |
| 110 | if (!behaviorActive| TRUE | evaluated 204 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | evaluated 52 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicksmoothedanimation
|
&& d->targetValue == currentValue| TRUE | evaluated 34 times by 3 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
| | FALSE | evaluated 170 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
) { | 34-204 |
| 111 | QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding); | - |
| 112 | return;executed 34 times by 3 tests: return;Executed by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
| 34 |
| 113 | } | - |
| 114 | | - |
| 115 | QQuickStateOperation::ActionList actions; | - |
| 116 | QQuickStateAction action; | - |
| 117 | action.property = d->property; | - |
| 118 | action.fromValue = currentValue; | - |
| 119 | action.toValue = value; | - |
| 120 | actions << action; | - |
| 121 | | - |
| 122 | QList<QQmlProperty> after; | - |
| 123 | QAbstractAnimationJob *prev = d->animationInstance; | - |
| 124 | d->animationInstance = d->animation->transition(actions, after, QQuickAbstractAnimation::Forward); | - |
| 125 | | - |
| 126 | if (d->animationInstance| TRUE | evaluated 222 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | never evaluated |
&& d->animation->threadingModel() == QQuickAbstractAnimation::RenderThread| TRUE | never evaluated | | FALSE | evaluated 222 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
) | 0-222 |
| 127 | d->animationInstance = new QQuickAnimatorProxyJob(d->animationInstance, d->animation); never executed: d->animationInstance = new QQuickAnimatorProxyJob(d->animationInstance, d->animation); | 0 |
| 128 | | - |
| 129 | if (prev| TRUE | evaluated 64 times by 3 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
| | FALSE | evaluated 158 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
&& prev != d->animationInstance| TRUE | evaluated 64 times by 3 testsEvaluated by:- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
| | FALSE | never evaluated |
) | 0-158 |
| 130 | delete prev;executed 64 times by 3 tests: delete prev;Executed by:- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
| 64 |
| 131 | | - |
| 132 | if (d->animationInstance| TRUE | evaluated 222 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | never evaluated |
) { | 0-222 |
| 133 | if (d->animationInstance != prev| TRUE | evaluated 222 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | never evaluated |
) | 0-222 |
| 134 | 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 |
| 135 | d->animationInstance->start(); | - |
| 136 | d->blockRunningChanged = false; | - |
| 137 | }executed 222 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 222 |
| 138 | if (!after.contains(d->property)| TRUE | evaluated 10 times by 2 testsEvaluated by:- tst_qquickbehaviors
- tst_qquickloader
| | FALSE | evaluated 212 times by 6 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquicksmoothedanimation
|
) | 10-212 |
| 139 | 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 |
| 140 | }executed 222 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 222 |
| 141 | | - |
| 142 | void QQuickBehavior::setTarget(const QQmlProperty &property) | - |
| 143 | { | - |
| 144 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 145 | d->property = property; | - |
| 146 | if (d->animation| TRUE | evaluated 24 times by 4 testsEvaluated by:- tst_examples
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicksmoothedanimation
| | FALSE | evaluated 534 times by 5 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
|
) | 24-534 |
| 147 | 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 |
| 148 | | - |
| 149 | QQmlEnginePrivate *engPriv = QQmlEnginePrivate::get(qmlEngine(this)); | - |
| 150 | static int finalizedIdx = -1; | - |
| 151 | if (finalizedIdx < 0| TRUE | evaluated 14 times by 7 testsEvaluated by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| | FALSE | evaluated 544 times by 6 testsEvaluated by:- tst_examples
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
|
) | 14-544 |
| 152 | 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 |
| 153 | engPriv->registerFinalizeCallback(this, finalizedIdx); | - |
| 154 | }executed 558 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 558 |
| 155 | | - |
| 156 | void QQuickBehavior::componentFinalized() | - |
| 157 | { | - |
| 158 | QQuickBehaviorPrivate * const d = d_func(); | - |
| 159 | d->finalized = true; | - |
| 160 | }executed 558 times by 7 tests: end of blockExecuted by:- tst_examples
- tst_qquickanimatedimage
- tst_qquickanimations
- tst_qquickbehaviors
- tst_qquicklistview
- tst_qquickloader
- tst_qquicksmoothedanimation
| 558 |
| 161 | | - |
| 162 | | - |
| 163 | | - |
| | |