| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickanimator.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | QQuickAnimator::QQuickAnimator(QQuickAnimatorPrivate &dd, QObject *parent) | - | ||||||||||||
| 5 | : QQuickAbstractAnimation(dd, parent) | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||
| 8 | - | |||||||||||||
| 9 | QQuickAnimator::QQuickAnimator(QObject *parent) | - | ||||||||||||
| 10 | : QQuickAbstractAnimation(*new QQuickAnimatorPrivate, parent) | - | ||||||||||||
| 11 | { | - | ||||||||||||
| 12 | } executed 28 times by 2 tests: end of blockExecuted by:
| 28 | ||||||||||||
| 13 | void QQuickAnimator::setTargetItem(QQuickItem *target) | - | ||||||||||||
| 14 | { | - | ||||||||||||
| 15 | QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 16 | if (target == d->target
| 0-24 | ||||||||||||
| 17 | return; never executed: return; | 0 | ||||||||||||
| 18 | d->target = target; | - | ||||||||||||
| 19 | targetItemChanged(d->target); | - | ||||||||||||
| 20 | } executed 24 times by 2 tests: end of blockExecuted by:
| 24 | ||||||||||||
| 21 | - | |||||||||||||
| 22 | QQuickItem *QQuickAnimator::targetItem() const | - | ||||||||||||
| 23 | { | - | ||||||||||||
| 24 | const QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 25 | return never executed: d->target;return d->target;never executed: return d->target; | 0 | ||||||||||||
| 26 | } | - | ||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | - | |||||||||||||
| 32 | - | |||||||||||||
| 33 | - | |||||||||||||
| 34 | void QQuickAnimator::setDuration(int duration) | - | ||||||||||||
| 35 | { | - | ||||||||||||
| 36 | QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 37 | if (duration == d->duration
| 0-36 | ||||||||||||
| 38 | return; never executed: return; | 0 | ||||||||||||
| 39 | d->duration = duration; | - | ||||||||||||
| 40 | durationChanged(duration); | - | ||||||||||||
| 41 | } executed 36 times by 2 tests: end of blockExecuted by:
| 36 | ||||||||||||
| 42 | - | |||||||||||||
| 43 | int QQuickAnimator::duration() const | - | ||||||||||||
| 44 | { | - | ||||||||||||
| 45 | const QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 46 | return never executed: d->duration;return d->duration;never executed: return d->duration; | 0 | ||||||||||||
| 47 | } | - | ||||||||||||
| 48 | void QQuickAnimator::setEasing(const QEasingCurve &easing) | - | ||||||||||||
| 49 | { | - | ||||||||||||
| 50 | QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 51 | if (easing == d->easing
| 0-8 | ||||||||||||
| 52 | return; never executed: return; | 0 | ||||||||||||
| 53 | d->easing = easing; | - | ||||||||||||
| 54 | easingChanged(d->easing); | - | ||||||||||||
| 55 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||
| 56 | - | |||||||||||||
| 57 | QEasingCurve QQuickAnimator::easing() const | - | ||||||||||||
| 58 | { | - | ||||||||||||
| 59 | const QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 60 | return executed 8 times by 1 test: d->easing;return d->easing;Executed by:
executed 8 times by 1 test: return d->easing;Executed by:
| 8 | ||||||||||||
| 61 | } | - | ||||||||||||
| 62 | void QQuickAnimator::setTo(qreal to) | - | ||||||||||||
| 63 | { | - | ||||||||||||
| 64 | QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 65 | if (to == d->to
| 10-26 | ||||||||||||
| 66 | return; executed 10 times by 2 tests: return;Executed by:
| 10 | ||||||||||||
| 67 | d->isToDefined = true; | - | ||||||||||||
| 68 | d->to = to; | - | ||||||||||||
| 69 | toChanged(d->to); | - | ||||||||||||
| 70 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||||||||
| 71 | - | |||||||||||||
| 72 | qreal QQuickAnimator::to() const | - | ||||||||||||
| 73 | { | - | ||||||||||||
| 74 | const QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 75 | return never executed: d->to;return d->to;never executed: return d->to; | 0 | ||||||||||||
| 76 | } | - | ||||||||||||
| 77 | void QQuickAnimator::setFrom(qreal from) | - | ||||||||||||
| 78 | { | - | ||||||||||||
| 79 | QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 80 | if (from == d->from
| 12-24 | ||||||||||||
| 81 | return; executed 12 times by 1 test: return;Executed by:
| 12 | ||||||||||||
| 82 | d->isFromDefined = true; | - | ||||||||||||
| 83 | d->from = from; | - | ||||||||||||
| 84 | fromChanged(d->from); | - | ||||||||||||
| 85 | } executed 24 times by 2 tests: end of blockExecuted by:
| 24 | ||||||||||||
| 86 | - | |||||||||||||
| 87 | qreal QQuickAnimator::from() const | - | ||||||||||||
| 88 | { | - | ||||||||||||
| 89 | const QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 90 | return never executed: d->from;return d->from;never executed: return d->from; | 0 | ||||||||||||
| 91 | } | - | ||||||||||||
| 92 | - | |||||||||||||
| 93 | void QQuickAnimatorPrivate::apply(QQuickAnimatorJob *job, | - | ||||||||||||
| 94 | const QString &propertyName, | - | ||||||||||||
| 95 | QQuickStateActions &actions, | - | ||||||||||||
| 96 | QQmlProperties &modified, | - | ||||||||||||
| 97 | QObject *defaultTarget) | - | ||||||||||||
| 98 | { | - | ||||||||||||
| 99 | - | |||||||||||||
| 100 | if (actions.size()
| 0-36 | ||||||||||||
| 101 | for (int i=0; i<actions.size()
| 0 | ||||||||||||
| 102 | QQuickStateAction &action = actions[i]; | - | ||||||||||||
| 103 | if (action.property.name() != propertyName
| 0 | ||||||||||||
| 104 | continue; never executed: continue; | 0 | ||||||||||||
| 105 | modified << action.property; | - | ||||||||||||
| 106 | - | |||||||||||||
| 107 | job->setTarget(qobject_cast<QQuickItem *>(action.property.object())); | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | if (isFromDefined
| 0 | ||||||||||||
| 110 | job->setFrom(from); never executed: job->setFrom(from); | 0 | ||||||||||||
| 111 | else if (action.fromValue.isValid()
| 0 | ||||||||||||
| 112 | job->setFrom(action.fromValue.toReal()); never executed: job->setFrom(action.fromValue.toReal()); | 0 | ||||||||||||
| 113 | else | - | ||||||||||||
| 114 | job->setFrom(action.property.read().toReal()); never executed: job->setFrom(action.property.read().toReal()); | 0 | ||||||||||||
| 115 | - | |||||||||||||
| 116 | if (isToDefined
| 0 | ||||||||||||
| 117 | job->setTo(to); never executed: job->setTo(to); | 0 | ||||||||||||
| 118 | else if (action.toValue.isValid()
| 0 | ||||||||||||
| 119 | job->setTo(action.toValue.toReal()); never executed: job->setTo(action.toValue.toReal()); | 0 | ||||||||||||
| 120 | else | - | ||||||||||||
| 121 | job->setTo(action.property.read().toReal()); never executed: job->setTo(action.property.read().toReal()); | 0 | ||||||||||||
| 122 | - | |||||||||||||
| 123 | - | |||||||||||||
| 124 | - | |||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | action.fromValue = action.toValue; | - | ||||||||||||
| 128 | } never executed: end of block | 0 | ||||||||||||
| 129 | } never executed: end of block | 0 | ||||||||||||
| 130 | - | |||||||||||||
| 131 | if (modified.isEmpty()
| 0-36 | ||||||||||||
| 132 | job->setTarget(target); | - | ||||||||||||
| 133 | job->setFrom(from); | - | ||||||||||||
| 134 | job->setTo(to); | - | ||||||||||||
| 135 | } executed 36 times by 2 tests: end of blockExecuted by:
| 36 | ||||||||||||
| 136 | - | |||||||||||||
| 137 | if (!job->target()
| 12-24 | ||||||||||||
| 138 | if (defaultProperty.object()
| 0-12 | ||||||||||||
| 139 | job->setTarget(qobject_cast<QQuickItem *>(defaultProperty.object())); executed 12 times by 1 test: job->setTarget(qobject_cast<QQuickItem *>(defaultProperty.object()));Executed by:
| 12 | ||||||||||||
| 140 | else | - | ||||||||||||
| 141 | job->setTarget(qobject_cast<QQuickItem *>(defaultTarget)); never executed: job->setTarget(qobject_cast<QQuickItem *>(defaultTarget)); | 0 | ||||||||||||
| 142 | } | - | ||||||||||||
| 143 | - | |||||||||||||
| 144 | job->setDuration(duration); | - | ||||||||||||
| 145 | job->setLoopCount(loopCount); | - | ||||||||||||
| 146 | job->setEasingCurve(easing); | - | ||||||||||||
| 147 | } executed 36 times by 2 tests: end of blockExecuted by:
| 36 | ||||||||||||
| 148 | - | |||||||||||||
| 149 | QAbstractAnimationJob *QQuickAnimator::transition(QQuickStateActions &actions, | - | ||||||||||||
| 150 | QQmlProperties &modified, | - | ||||||||||||
| 151 | TransitionDirection direction, | - | ||||||||||||
| 152 | QObject *defaultTarget) | - | ||||||||||||
| 153 | { | - | ||||||||||||
| 154 | QQuickAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 155 | - | |||||||||||||
| 156 | if (d->defaultProperty.isValid()
| 0-24 | ||||||||||||
| 157 | QMessageLogger(__FILE__, 282, __PRETTY_FUNCTION__).debug() << __PRETTY_FUNCTION__ << "property name conflict..."; | - | ||||||||||||
| 158 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 159 | } | - | ||||||||||||
| 160 | - | |||||||||||||
| 161 | - | |||||||||||||
| 162 | if (direction == Backward
| 0-36 | ||||||||||||
| 163 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 164 | - | |||||||||||||
| 165 | QQuickAnimatorJob *job = createJob(); | - | ||||||||||||
| 166 | if (!job
| 0-36 | ||||||||||||
| 167 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 168 | - | |||||||||||||
| 169 | d->apply(job, propertyName(), actions, modified, defaultTarget); | - | ||||||||||||
| 170 | - | |||||||||||||
| 171 | if (!job->target()
| 0-36 | ||||||||||||
| 172 | delete job; | - | ||||||||||||
| 173 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 174 | } | - | ||||||||||||
| 175 | - | |||||||||||||
| 176 | return executed 36 times by 2 tests: job;return job;Executed by:
executed 36 times by 2 tests: return job;Executed by:
| 36 | ||||||||||||
| 177 | } | - | ||||||||||||
| 178 | QQuickXAnimator::QQuickXAnimator(QObject *parent) : QQuickAnimator(parent) {} executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 179 | - | |||||||||||||
| 180 | QQuickAnimatorJob *QQuickXAnimator::createJob() const { return executed 4 times by 1 test: new QQuickXAnimatorJob();return new QQuickXAnimatorJob();Executed by:
executed 4 times by 1 test: }return new QQuickXAnimatorJob();Executed by:
| 4 | ||||||||||||
| 181 | QQuickYAnimator::QQuickYAnimator(QObject *parent) : QQuickAnimator(parent) {} executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||
| 182 | - | |||||||||||||
| 183 | QQuickAnimatorJob *QQuickYAnimator::createJob() const { return executed 8 times by 1 test: new QQuickYAnimatorJob();return new QQuickYAnimatorJob();Executed by:
executed 8 times by 1 test: }return new QQuickYAnimatorJob();Executed by:
| 8 | ||||||||||||
| 184 | QQuickScaleAnimator::QQuickScaleAnimator(QObject *parent) : QQuickAnimator(parent) {} executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||
| 185 | - | |||||||||||||
| 186 | QQuickAnimatorJob *QQuickScaleAnimator::createJob() const { return executed 10 times by 1 test: new QQuickScaleAnimatorJob();return new QQuickScaleAnimatorJob();Executed by:
executed 10 times by 1 test: }return new QQuickScaleAnimatorJob();Executed by:
| 10 | ||||||||||||
| 187 | QQuickOpacityAnimator::QQuickOpacityAnimator(QObject *parent) : QQuickAnimator(parent) {} executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||
| 188 | - | |||||||||||||
| 189 | QQuickAnimatorJob *QQuickOpacityAnimator::createJob() const { return executed 6 times by 2 tests: new QQuickOpacityAnimatorJob();return new QQuickOpacityAnimatorJob();Executed by:
executed 6 times by 2 tests: }return new QQuickOpacityAnimatorJob();Executed by:
| 6 | ||||||||||||
| 190 | QQuickRotationAnimator::QQuickRotationAnimator(QObject *parent) | - | ||||||||||||
| 191 | : QQuickAnimator(*new QQuickRotationAnimatorPrivate, parent) | - | ||||||||||||
| 192 | { | - | ||||||||||||
| 193 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 194 | - | |||||||||||||
| 195 | QQuickAnimatorJob *QQuickRotationAnimator::createJob() const { | - | ||||||||||||
| 196 | const QQuickRotationAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 197 | QQuickRotationAnimatorJob *job = new QQuickRotationAnimatorJob(); | - | ||||||||||||
| 198 | job->setDirection(d->direction); | - | ||||||||||||
| 199 | return executed 4 times by 1 test: job;return job;Executed by:
executed 4 times by 1 test: return job;Executed by:
| 4 | ||||||||||||
| 200 | } | - | ||||||||||||
| 201 | void QQuickRotationAnimator::setDirection(RotationDirection dir) | - | ||||||||||||
| 202 | { | - | ||||||||||||
| 203 | QQuickRotationAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 204 | if (d->direction == dir
| 0 | ||||||||||||
| 205 | return; never executed: return; | 0 | ||||||||||||
| 206 | d->direction = dir; | - | ||||||||||||
| 207 | directionChanged(d->direction); | - | ||||||||||||
| 208 | } never executed: end of block | 0 | ||||||||||||
| 209 | - | |||||||||||||
| 210 | QQuickRotationAnimator::RotationDirection QQuickRotationAnimator::direction() const | - | ||||||||||||
| 211 | { | - | ||||||||||||
| 212 | const QQuickRotationAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 213 | return never executed: d->direction;return d->direction;never executed: return d->direction; | 0 | ||||||||||||
| 214 | } | - | ||||||||||||
| 215 | QQuickUniformAnimator::QQuickUniformAnimator(QObject *parent) | - | ||||||||||||
| 216 | : QQuickAnimator(*new QQuickUniformAnimatorPrivate, parent) | - | ||||||||||||
| 217 | { | - | ||||||||||||
| 218 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||
| 219 | void QQuickUniformAnimator::setUniform(const QString &uniform) | - | ||||||||||||
| 220 | { | - | ||||||||||||
| 221 | QQuickUniformAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 222 | if (d->uniform == uniform
| 0-2 | ||||||||||||
| 223 | return; never executed: return; | 0 | ||||||||||||
| 224 | d->uniform = uniform; | - | ||||||||||||
| 225 | uniformChanged(d->uniform); | - | ||||||||||||
| 226 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||
| 227 | - | |||||||||||||
| 228 | QString QQuickUniformAnimator::uniform() const | - | ||||||||||||
| 229 | { | - | ||||||||||||
| 230 | const QQuickUniformAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 231 | return never executed: d->uniform;return d->uniform;never executed: return d->uniform; | 0 | ||||||||||||
| 232 | } | - | ||||||||||||
| 233 | - | |||||||||||||
| 234 | QString QQuickUniformAnimator::propertyName() const | - | ||||||||||||
| 235 | { | - | ||||||||||||
| 236 | const QQuickUniformAnimatorPrivate * const d = d_func(); | - | ||||||||||||
| 237 | if (!d->uniform.isEmpty()
| 4-6 | ||||||||||||
| 238 | return executed 4 times by 1 test: d->uniform;return d->uniform;Executed by:
executed 4 times by 1 test: return d->uniform;Executed by:
| 4 | ||||||||||||
| 239 | return executed 6 times by 1 test: d->defaultProperty.name();return d->defaultProperty.name();Executed by:
executed 6 times by 1 test: return d->defaultProperty.name();Executed by:
| 6 | ||||||||||||
| 240 | } | - | ||||||||||||
| 241 | - | |||||||||||||
| 242 | QQuickAnimatorJob *QQuickUniformAnimator::createJob() const | - | ||||||||||||
| 243 | { | - | ||||||||||||
| 244 | QString u = propertyName(); | - | ||||||||||||
| 245 | if (u.isEmpty()
| 0-4 | ||||||||||||
| 246 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 247 | - | |||||||||||||
| 248 | QQuickUniformAnimatorJob *job = new QQuickUniformAnimatorJob(); | - | ||||||||||||
| 249 | job->setUniform(u.toLatin1()); | - | ||||||||||||
| 250 | return executed 4 times by 1 test: job;return job;Executed by:
executed 4 times by 1 test: return job;Executed by:
| 4 | ||||||||||||
| 251 | } | - | ||||||||||||
| 252 | - | |||||||||||||
| 253 | - | |||||||||||||
| 254 | - | |||||||||||||
| 255 | - | |||||||||||||
| Switch to Source code | Preprocessed file |