| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/animation/qpropertyanimation.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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 QtCore 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 | /*! | - | ||||||||||||||||||
| 41 | \class QPropertyAnimation | - | ||||||||||||||||||
| 42 | \inmodule QtCore | - | ||||||||||||||||||
| 43 | \brief The QPropertyAnimation class animates Qt properties | - | ||||||||||||||||||
| 44 | \since 4.6 | - | ||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | \ingroup animation | - | ||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | QPropertyAnimation interpolates over \l{Qt's Property System}{Qt | - | ||||||||||||||||||
| 49 | properties}. As property values are stored in \l{QVariant}s, the | - | ||||||||||||||||||
| 50 | class inherits QVariantAnimation, and supports animation of the | - | ||||||||||||||||||
| 51 | same \l{QMetaType::Type}{meta types} as its super class. | - | ||||||||||||||||||
| 52 | - | |||||||||||||||||||
| 53 | A class declaring properties must be a QObject. To make it | - | ||||||||||||||||||
| 54 | possible to animate a property, it must provide a setter (so that | - | ||||||||||||||||||
| 55 | QPropertyAnimation can set the property's value). Note that this | - | ||||||||||||||||||
| 56 | makes it possible to animate many of Qt's widgets. Let's look at | - | ||||||||||||||||||
| 57 | an example: | - | ||||||||||||||||||
| 58 | - | |||||||||||||||||||
| 59 | \code | - | ||||||||||||||||||
| 60 | QPropertyAnimation *animation = new QPropertyAnimation(myWidget, "geometry"); | - | ||||||||||||||||||
| 61 | animation->setDuration(10000); | - | ||||||||||||||||||
| 62 | animation->setStartValue(QRect(0, 0, 100, 30)); | - | ||||||||||||||||||
| 63 | animation->setEndValue(QRect(250, 250, 100, 30)); | - | ||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | animation->start(); | - | ||||||||||||||||||
| 66 | \endcode | - | ||||||||||||||||||
| 67 | - | |||||||||||||||||||
| 68 | The property name and the QObject instance of which property | - | ||||||||||||||||||
| 69 | should be animated are passed to the constructor. You can then | - | ||||||||||||||||||
| 70 | specify the start and end value of the property. The procedure is | - | ||||||||||||||||||
| 71 | equal for properties in classes you have implemented | - | ||||||||||||||||||
| 72 | yourself--just check with QVariantAnimation that your QVariant | - | ||||||||||||||||||
| 73 | type is supported. | - | ||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | The QVariantAnimation class description explains how to set up the | - | ||||||||||||||||||
| 76 | animation in detail. Note, however, that if a start value is not | - | ||||||||||||||||||
| 77 | set, the property will start at the value it had when the | - | ||||||||||||||||||
| 78 | QPropertyAnimation instance was created. | - | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | QPropertyAnimation works like a charm on its own. For complex | - | ||||||||||||||||||
| 81 | animations that, for instance, contain several objects, | - | ||||||||||||||||||
| 82 | QAnimationGroup is provided. An animation group is an animation | - | ||||||||||||||||||
| 83 | that can contain other animations, and that can manage when its | - | ||||||||||||||||||
| 84 | animations are played. Look at QParallelAnimationGroup for an | - | ||||||||||||||||||
| 85 | example. | - | ||||||||||||||||||
| 86 | - | |||||||||||||||||||
| 87 | \sa QVariantAnimation, QAnimationGroup, {The Animation Framework} | - | ||||||||||||||||||
| 88 | */ | - | ||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | #include "qpropertyanimation.h" | - | ||||||||||||||||||
| 91 | #include "qanimationgroup.h" | - | ||||||||||||||||||
| 92 | #include "qpropertyanimation_p.h" | - | ||||||||||||||||||
| 93 | - | |||||||||||||||||||
| 94 | #include <QtCore/QMutex> | - | ||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | #ifndef QT_NO_ANIMATION | - | ||||||||||||||||||
| 97 | - | |||||||||||||||||||
| 98 | QT_BEGIN_NAMESPACE | - | ||||||||||||||||||
| 99 | - | |||||||||||||||||||
| 100 | void QPropertyAnimationPrivate::updateMetaProperty() | - | ||||||||||||||||||
| 101 | { | - | ||||||||||||||||||
| 102 | if (!target || propertyName.isEmpty()) {
| 0-3145 | ||||||||||||||||||
| 103 | propertyType = QVariant::Invalid; | - | ||||||||||||||||||
| 104 | propertyIndex = -1; | - | ||||||||||||||||||
| 105 | return; executed 1035 times by 23 tests: return;Executed by:
| 1035 | ||||||||||||||||||
| 106 | } | - | ||||||||||||||||||
| 107 | - | |||||||||||||||||||
| 108 | //propertyType will be set to a valid type only if there is a Q_PROPERTY | - | ||||||||||||||||||
| 109 | //otherwise it will be set to QVariant::Invalid at the end of this function | - | ||||||||||||||||||
| 110 | propertyType = targetValue->property(propertyName).userType(); | - | ||||||||||||||||||
| 111 | propertyIndex = targetValue->metaObject()->indexOfProperty(propertyName); | - | ||||||||||||||||||
| 112 | - | |||||||||||||||||||
| 113 | if (propertyType != QVariant::Invalid)
| 0-2110 | ||||||||||||||||||
| 114 | convertValues(propertyType); executed 2110 times by 23 tests: convertValues(propertyType);Executed by:
| 2110 | ||||||||||||||||||
| 115 | if (propertyIndex == -1) {
| 181-1929 | ||||||||||||||||||
| 116 | //there is no Q_PROPERTY on the object | - | ||||||||||||||||||
| 117 | propertyType = QVariant::Invalid; | - | ||||||||||||||||||
| 118 | if (!targetValue->dynamicPropertyNames().contains(propertyName))
| 0-181 | ||||||||||||||||||
| 119 | qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData()); never executed: QMessageLogger(__FILE__, 119, __PRETTY_FUNCTION__).warning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData()); | 0 | ||||||||||||||||||
| 120 | } else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) { executed 181 times by 6 tests: end of blockExecuted by:
| 0-1929 | ||||||||||||||||||
| 121 | qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData()); | - | ||||||||||||||||||
| 122 | } never executed: end of block | 0 | ||||||||||||||||||
| 123 | } executed 2110 times by 23 tests: end of blockExecuted by:
| 2110 | ||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue) | - | ||||||||||||||||||
| 126 | { | - | ||||||||||||||||||
| 127 | if (state == QAbstractAnimation::Stopped)
| 101-4023 | ||||||||||||||||||
| 128 | return; executed 101 times by 4 tests: return;Executed by:
| 101 | ||||||||||||||||||
| 129 | - | |||||||||||||||||||
| 130 | if (!target) {
| 2-4021 | ||||||||||||||||||
| 131 | q_func()->stop(); //the target was destroyed we need to stop the animation | - | ||||||||||||||||||
| 132 | return; executed 2 times by 2 tests: return;Executed by:
| 2 | ||||||||||||||||||
| 133 | } | - | ||||||||||||||||||
| 134 | - | |||||||||||||||||||
| 135 | if (newValue.userType() == propertyType) {
| 1092-2929 | ||||||||||||||||||
| 136 | //no conversion is needed, we directly call the QMetaObject::metacall | - | ||||||||||||||||||
| 137 | //check QMetaProperty::write for an explanation of these | - | ||||||||||||||||||
| 138 | int status = -1; | - | ||||||||||||||||||
| 139 | int flags = 0; | - | ||||||||||||||||||
| 140 | void *argv[] = { const_cast<void *>(newValue.constData()), const_cast<QVariant *>(&newValue), &status, &flags }; | - | ||||||||||||||||||
| 141 | QMetaObject::metacall(targetValue, QMetaObject::WriteProperty, propertyIndex, argv); | - | ||||||||||||||||||
| 142 | } else { executed 2929 times by 20 tests: end of blockExecuted by:
| 2929 | ||||||||||||||||||
| 143 | targetValue->setProperty(propertyName.constData(), newValue); | - | ||||||||||||||||||
| 144 | } executed 1092 times by 6 tests: end of blockExecuted by:
| 1092 | ||||||||||||||||||
| 145 | } | - | ||||||||||||||||||
| 146 | - | |||||||||||||||||||
| 147 | /*! | - | ||||||||||||||||||
| 148 | Construct a QPropertyAnimation object. \a parent is passed to QObject's | - | ||||||||||||||||||
| 149 | constructor. | - | ||||||||||||||||||
| 150 | */ | - | ||||||||||||||||||
| 151 | QPropertyAnimation::QPropertyAnimation(QObject *parent) | - | ||||||||||||||||||
| 152 | : QVariantAnimation(*new QPropertyAnimationPrivate, parent) | - | ||||||||||||||||||
| 153 | { | - | ||||||||||||||||||
| 154 | } executed 111 times by 4 tests: end of blockExecuted by:
| 111 | ||||||||||||||||||
| 155 | - | |||||||||||||||||||
| 156 | /*! | - | ||||||||||||||||||
| 157 | Construct a QPropertyAnimation object. \a parent is passed to QObject's | - | ||||||||||||||||||
| 158 | constructor. The animation changes the property \a propertyName on \a | - | ||||||||||||||||||
| 159 | target. The default duration is 250ms. | - | ||||||||||||||||||
| 160 | - | |||||||||||||||||||
| 161 | \sa targetObject, propertyName | - | ||||||||||||||||||
| 162 | */ | - | ||||||||||||||||||
| 163 | QPropertyAnimation::QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent) | - | ||||||||||||||||||
| 164 | : QVariantAnimation(*new QPropertyAnimationPrivate, parent) | - | ||||||||||||||||||
| 165 | { | - | ||||||||||||||||||
| 166 | setTargetObject(target); | - | ||||||||||||||||||
| 167 | setPropertyName(propertyName); | - | ||||||||||||||||||
| 168 | } executed 964 times by 22 tests: end of blockExecuted by:
| 964 | ||||||||||||||||||
| 169 | - | |||||||||||||||||||
| 170 | /*! | - | ||||||||||||||||||
| 171 | Destroys the QPropertyAnimation instance. | - | ||||||||||||||||||
| 172 | */ | - | ||||||||||||||||||
| 173 | QPropertyAnimation::~QPropertyAnimation() | - | ||||||||||||||||||
| 174 | { | - | ||||||||||||||||||
| 175 | stop(); | - | ||||||||||||||||||
| 176 | } executed 1071 times by 23 tests: end of blockExecuted by:
| 1071 | ||||||||||||||||||
| 177 | - | |||||||||||||||||||
| 178 | /*! | - | ||||||||||||||||||
| 179 | \property QPropertyAnimation::targetObject | - | ||||||||||||||||||
| 180 | \brief the target QObject for this animation. | - | ||||||||||||||||||
| 181 | - | |||||||||||||||||||
| 182 | This property defines the target QObject for this animation. | - | ||||||||||||||||||
| 183 | */ | - | ||||||||||||||||||
| 184 | QObject *QPropertyAnimation::targetObject() const | - | ||||||||||||||||||
| 185 | { | - | ||||||||||||||||||
| 186 | return d_func()->target.data(); executed 898 times by 17 tests: return d_func()->target.data();Executed by:
| 898 | ||||||||||||||||||
| 187 | } | - | ||||||||||||||||||
| 188 | - | |||||||||||||||||||
| 189 | void QPropertyAnimation::setTargetObject(QObject *target) | - | ||||||||||||||||||
| 190 | { | - | ||||||||||||||||||
| 191 | Q_D(QPropertyAnimation); | - | ||||||||||||||||||
| 192 | if (d->target.data() == target)
| 0-1035 | ||||||||||||||||||
| 193 | return; never executed: return; | 0 | ||||||||||||||||||
| 194 | - | |||||||||||||||||||
| 195 | if (d->state != QAbstractAnimation::Stopped) {
| 0-1035 | ||||||||||||||||||
| 196 | qWarning("QPropertyAnimation::setTargetObject: you can't change the target of a running animation"); | - | ||||||||||||||||||
| 197 | return; never executed: return; | 0 | ||||||||||||||||||
| 198 | } | - | ||||||||||||||||||
| 199 | - | |||||||||||||||||||
| 200 | d->target = d->targetValue = target; | - | ||||||||||||||||||
| 201 | d->updateMetaProperty(); | - | ||||||||||||||||||
| 202 | } executed 1035 times by 23 tests: end of blockExecuted by:
| 1035 | ||||||||||||||||||
| 203 | - | |||||||||||||||||||
| 204 | /*! | - | ||||||||||||||||||
| 205 | \property QPropertyAnimation::propertyName | - | ||||||||||||||||||
| 206 | \brief the target property name for this animation | - | ||||||||||||||||||
| 207 | - | |||||||||||||||||||
| 208 | This property defines the target property name for this animation. The | - | ||||||||||||||||||
| 209 | property name is required for the animation to operate. | - | ||||||||||||||||||
| 210 | */ | - | ||||||||||||||||||
| 211 | QByteArray QPropertyAnimation::propertyName() const | - | ||||||||||||||||||
| 212 | { | - | ||||||||||||||||||
| 213 | Q_D(const QPropertyAnimation); | - | ||||||||||||||||||
| 214 | return d->propertyName; executed 46 times by 1 test: return d->propertyName;Executed by:
| 46 | ||||||||||||||||||
| 215 | } | - | ||||||||||||||||||
| 216 | - | |||||||||||||||||||
| 217 | void QPropertyAnimation::setPropertyName(const QByteArray &propertyName) | - | ||||||||||||||||||
| 218 | { | - | ||||||||||||||||||
| 219 | Q_D(QPropertyAnimation); | - | ||||||||||||||||||
| 220 | if (d->state != QAbstractAnimation::Stopped) {
| 0-1035 | ||||||||||||||||||
| 221 | qWarning("QPropertyAnimation::setPropertyName: you can't change the property name of a running animation"); | - | ||||||||||||||||||
| 222 | return; never executed: return; | 0 | ||||||||||||||||||
| 223 | } | - | ||||||||||||||||||
| 224 | - | |||||||||||||||||||
| 225 | d->propertyName = propertyName; | - | ||||||||||||||||||
| 226 | d->updateMetaProperty(); | - | ||||||||||||||||||
| 227 | } executed 1035 times by 23 tests: end of blockExecuted by:
| 1035 | ||||||||||||||||||
| 228 | - | |||||||||||||||||||
| 229 | - | |||||||||||||||||||
| 230 | /*! | - | ||||||||||||||||||
| 231 | \reimp | - | ||||||||||||||||||
| 232 | */ | - | ||||||||||||||||||
| 233 | bool QPropertyAnimation::event(QEvent *event) | - | ||||||||||||||||||
| 234 | { | - | ||||||||||||||||||
| 235 | return QVariantAnimation::event(event); executed 448 times by 17 tests: return QVariantAnimation::event(event);Executed by:
| 448 | ||||||||||||||||||
| 236 | } | - | ||||||||||||||||||
| 237 | - | |||||||||||||||||||
| 238 | /*! | - | ||||||||||||||||||
| 239 | This virtual function is called by QVariantAnimation whenever the current value | - | ||||||||||||||||||
| 240 | changes. \a value is the new, updated value. It updates the current value | - | ||||||||||||||||||
| 241 | of the property on the target object. | - | ||||||||||||||||||
| 242 | - | |||||||||||||||||||
| 243 | \sa currentValue, currentTime | - | ||||||||||||||||||
| 244 | */ | - | ||||||||||||||||||
| 245 | void QPropertyAnimation::updateCurrentValue(const QVariant &value) | - | ||||||||||||||||||
| 246 | { | - | ||||||||||||||||||
| 247 | Q_D(QPropertyAnimation); | - | ||||||||||||||||||
| 248 | d->updateProperty(value); | - | ||||||||||||||||||
| 249 | } executed 4124 times by 23 tests: end of blockExecuted by:
| 4124 | ||||||||||||||||||
| 250 | - | |||||||||||||||||||
| 251 | /*! | - | ||||||||||||||||||
| 252 | \reimp | - | ||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | If the startValue is not defined when the state of the animation changes from Stopped to Running, | - | ||||||||||||||||||
| 255 | the current property value is used as the initial value for the animation. | - | ||||||||||||||||||
| 256 | */ | - | ||||||||||||||||||
| 257 | void QPropertyAnimation::updateState(QAbstractAnimation::State newState, | - | ||||||||||||||||||
| 258 | QAbstractAnimation::State oldState) | - | ||||||||||||||||||
| 259 | { | - | ||||||||||||||||||
| 260 | Q_D(QPropertyAnimation); | - | ||||||||||||||||||
| 261 | - | |||||||||||||||||||
| 262 | if (!d->target && oldState == Stopped) {
| 0-2168 | ||||||||||||||||||
| 263 | qWarning("QPropertyAnimation::updateState (%s): Changing state of an animation without target", | - | ||||||||||||||||||
| 264 | d->propertyName.constData()); | - | ||||||||||||||||||
| 265 | return; never executed: return; | 0 | ||||||||||||||||||
| 266 | } | - | ||||||||||||||||||
| 267 | - | |||||||||||||||||||
| 268 | QVariantAnimation::updateState(newState, oldState); | - | ||||||||||||||||||
| 269 | - | |||||||||||||||||||
| 270 | QPropertyAnimation *animToStop = 0; | - | ||||||||||||||||||
| 271 | { | - | ||||||||||||||||||
| 272 | #ifndef QT_NO_THREAD | - | ||||||||||||||||||
| 273 | static QBasicMutex mutex; | - | ||||||||||||||||||
| 274 | QMutexLocker locker(&mutex); | - | ||||||||||||||||||
| 275 | #endif | - | ||||||||||||||||||
| 276 | typedef QPair<QObject *, QByteArray> QPropertyAnimationPair; | - | ||||||||||||||||||
| 277 | typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash; | - | ||||||||||||||||||
| 278 | static QPropertyAnimationHash hash; | - | ||||||||||||||||||
| 279 | //here we need to use value because we need to know to which pointer | - | ||||||||||||||||||
| 280 | //the animation was referring in case stopped because the target was destroyed | - | ||||||||||||||||||
| 281 | QPropertyAnimationPair key(d->targetValue, d->propertyName); | - | ||||||||||||||||||
| 282 | if (newState == Running) {
| 1075-1100 | ||||||||||||||||||
| 283 | d->updateMetaProperty(); | - | ||||||||||||||||||
| 284 | animToStop = hash.value(key, 0); | - | ||||||||||||||||||
| 285 | hash.insert(key, this); | - | ||||||||||||||||||
| 286 | locker.unlock(); | - | ||||||||||||||||||
| 287 | // update the default start value | - | ||||||||||||||||||
| 288 | if (oldState == Stopped) {
| 4-1071 | ||||||||||||||||||
| 289 | d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData())); | - | ||||||||||||||||||
| 290 | //let's check if we have a start value and an end value | - | ||||||||||||||||||
| 291 | if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) {
| 0-1035 | ||||||||||||||||||
| 292 | qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value", | - | ||||||||||||||||||
| 293 | d->propertyName.constData(), d->target.data()->metaObject()->className(), | - | ||||||||||||||||||
| 294 | qPrintable(d->target.data()->objectName())); | - | ||||||||||||||||||
| 295 | } never executed: end of block | 0 | ||||||||||||||||||
| 296 | if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) {
| 0-1069 | ||||||||||||||||||
| 297 | qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value", | - | ||||||||||||||||||
| 298 | d->propertyName.constData(), d->target.data()->metaObject()->className(), | - | ||||||||||||||||||
| 299 | qPrintable(d->target.data()->objectName())); | - | ||||||||||||||||||
| 300 | } never executed: end of block | 0 | ||||||||||||||||||
| 301 | } executed 1071 times by 23 tests: end of blockExecuted by:
| 1071 | ||||||||||||||||||
| 302 | } else if (hash.value(key) == this) { executed 1075 times by 23 tests: end of blockExecuted by:
| 26-1075 | ||||||||||||||||||
| 303 | hash.remove(key); | - | ||||||||||||||||||
| 304 | } executed 1074 times by 23 tests: end of blockExecuted by:
| 1074 | ||||||||||||||||||
| 305 | } | - | ||||||||||||||||||
| 306 | - | |||||||||||||||||||
| 307 | //we need to do that after the mutex was unlocked | - | ||||||||||||||||||
| 308 | if (animToStop) {
| 1-2174 | ||||||||||||||||||
| 309 | // try to stop the top level group | - | ||||||||||||||||||
| 310 | QAbstractAnimation *current = animToStop; | - | ||||||||||||||||||
| 311 | while (current->group() && current->state() != Stopped)
| 0-1 | ||||||||||||||||||
| 312 | current = current->group(); never executed: current = current->group(); | 0 | ||||||||||||||||||
| 313 | current->stop(); | - | ||||||||||||||||||
| 314 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 315 | } executed 2175 times by 23 tests: end of blockExecuted by:
| 2175 | ||||||||||||||||||
| 316 | - | |||||||||||||||||||
| 317 | #include "moc_qpropertyanimation.cpp" | - | ||||||||||||||||||
| 318 | - | |||||||||||||||||||
| 319 | QT_END_NAMESPACE | - | ||||||||||||||||||
| 320 | - | |||||||||||||||||||
| 321 | #endif //QT_NO_ANIMATION | - | ||||||||||||||||||
| Source code | Switch to Preprocessed file |