1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtCore module of the Qt Toolkit. |
7 ** This file is part of the QtCore module of the Qt Toolkit. |
8 ** |
8 ** |
254 QAbstractAnimation::State oldState) |
254 QAbstractAnimation::State oldState) |
255 { |
255 { |
256 Q_D(QPropertyAnimation); |
256 Q_D(QPropertyAnimation); |
257 |
257 |
258 if (!d->target && oldState == Stopped) { |
258 if (!d->target && oldState == Stopped) { |
259 qWarning("QPropertyAnimation::updateState: Changing state of an animation without target"); |
259 qWarning("QPropertyAnimation::updateState (%s): Changing state of an animation without target", |
|
260 d->propertyName.constData()); |
260 return; |
261 return; |
261 } |
262 } |
262 |
263 |
263 QVariantAnimation::updateState(newState, oldState); |
264 QVariantAnimation::updateState(newState, oldState); |
264 |
265 |
277 hash.insert(key, this); |
278 hash.insert(key, this); |
278 // update the default start value |
279 // update the default start value |
279 if (oldState == Stopped) { |
280 if (oldState == Stopped) { |
280 d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData())); |
281 d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData())); |
281 //let's check if we have a start value and an end value |
282 //let's check if we have a start value and an end value |
282 if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) |
283 if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) { |
283 qWarning("QPropertyAnimation::updateState: starting an animation without start value"); |
284 qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value", |
284 if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) |
285 d->propertyName.constData(), d->target.data()->metaObject()->className(), |
285 qWarning("QPropertyAnimation::updateState: starting an animation without end value"); |
286 qPrintable(d->target.data()->objectName())); |
|
287 } |
|
288 if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) { |
|
289 qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value", |
|
290 d->propertyName.constData(), d->target.data()->metaObject()->className(), |
|
291 qPrintable(d->target.data()->objectName())); |
|
292 } |
286 } |
293 } |
287 } else if (hash.value(key) == this) { |
294 } else if (hash.value(key) == this) { |
288 hash.remove(key); |
295 hash.remove(key); |
289 } |
296 } |
290 } |
297 } |