diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-29 09:40:14 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-29 09:51:18 (GMT) |
commit | ce0c22d4da46664636e651285f6e3ba38e77aea7 (patch) | |
tree | 06c131d04a87e8d73da286342831cd47704a6bfa /src/corelib/kernel | |
parent | 00908877d47c72e178cb0cee643229e3f3e1c64e (diff) | |
download | Qt-ce0c22d4da46664636e651285f6e3ba38e77aea7.zip Qt-ce0c22d4da46664636e651285f6e3ba38e77aea7.tar.gz Qt-ce0c22d4da46664636e651285f6e3ba38e77aea7.tar.bz2 |
Fix qvariant_cast<QVariant> when a QVariant is really inside a QVariant
This fix the QPropertyAnimation test.
Reviewed-by: Gabriel
Reviewed-by: Thierry
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index a1ab4e9..3c10788 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -581,6 +581,9 @@ template<typename T> inline T qvariant_cast(const QVariant &v) template<> inline QVariant qvariant_cast<QVariant>(const QVariant &v) { + static const int vid = qRegisterMetaType<QVariant>("QVariant"); + if (vid == v.userType()) + return *reinterpret_cast<const QVariant *>(v.constData()); return v; } |