From 2f48ff8cbefc70b2eb4de1e08a9e48c917486018 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 22 Jan 2010 11:34:39 +0100 Subject: Adding a warning if the property of an animation is not writable --- src/corelib/animation/qpropertyanimation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 19b493d..37b79ba 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -118,7 +118,9 @@ void QPropertyAnimationPrivate::updateMetaProperty() propertyType = QVariant::Invalid; if (!targetValue->dynamicPropertyNames().contains(propertyName)) qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData()); - } + } else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) { + qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData()); + } } void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue) -- cgit v0.12