diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-01-19 14:22:49 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2010-01-19 14:26:35 (GMT) |
commit | e318e3985247e0be91ae4f94afef7a39ea9928c6 (patch) | |
tree | c5dfec81961f7331c0d14a4d1572c509c2921f87 /src/corelib/animation/qpropertyanimation.cpp | |
parent | d9918f5b3a3e9f0504211b0ca7023300660faa6e (diff) | |
download | Qt-e318e3985247e0be91ae4f94afef7a39ea9928c6.zip Qt-e318e3985247e0be91ae4f94afef7a39ea9928c6.tar.gz Qt-e318e3985247e0be91ae4f94afef7a39ea9928c6.tar.bz2 |
Make the qWarnings in the animation API more useful.
Task-number:QTBUG-6895
Reviewed-by:Thierry
Diffstat (limited to 'src/corelib/animation/qpropertyanimation.cpp')
-rw-r--r-- | src/corelib/animation/qpropertyanimation.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index eec5b30..cfd7cc2 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -256,7 +256,8 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState, Q_D(QPropertyAnimation); if (!d->target && oldState == Stopped) { - qWarning("QPropertyAnimation::updateState: Changing state of an animation without target"); + qWarning("QPropertyAnimation::updateState (%s): Changing state of an animation without target", + d->propertyName.constData()); return; } @@ -279,10 +280,16 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState, if (oldState == Stopped) { d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData())); //let's check if we have a start value and an end value - if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) - qWarning("QPropertyAnimation::updateState: starting an animation without start value"); - if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) - qWarning("QPropertyAnimation::updateState: starting an animation without end value"); + if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) { + qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value", + d->propertyName.constData(), d->target.data()->metaObject()->className(), + qPrintable(d->target.data()->objectName())); + } + if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) { + qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value", + d->propertyName.constData(), d->target.data()->metaObject()->className(), + qPrintable(d->target.data()->objectName())); + } } } else if (hash.value(key) == this) { hash.remove(key); |