1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
From 03e96961b0f4fc2c290271c6e50a11aa334a40ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20E=2E=20Narv=C3=A1ez?= <david.narvaez@computer.org>
Date: Sun, 3 Feb 2013 23:07:07 -0500
Subject: [PATCH] Fix call to QMetaObject::metaCall from updateProperty
Create an array of arguments in the same way
QMetaObject::write does
Task-number: QTBUG-29082
Change-Id: I4ea5ab5dcd6b55cf0a127b855b5aac27a9d4a305
---
src/corelib/animation/qpropertyanimation.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index dcf779a..9869d7e 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -136,8 +136,11 @@ void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)
if (newValue.userType() == propertyType) {
//no conversion is needed, we directly call the QMetaObject::metacall
- void *data = const_cast<void*>(newValue.constData());
- QMetaObject::metacall(targetValue, QMetaObject::WriteProperty, propertyIndex, &data);
+ //check QMetaProperty::write for an explanation of these
+ int status = -1;
+ int flags = 0;
+ void *argv[] = { const_cast<void *>(newValue.constData()), const_cast<QVariant *>(&newValue), &status, &flags };
+ QMetaObject::metacall(targetValue, QMetaObject::WriteProperty, propertyIndex, argv);
} else {
targetValue->setProperty(propertyName.constData(), newValue);
}
--
1.8.1.2
|