From cc594d2064799f09f8d60981f75354745d98c717 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 5 Sep 2013 10:35:36 +0200 Subject: [PATCH] QVariant::canConvert: Use the old type when checking for QObject* conversion. Change-Id: I8450c74ecfdeee96e73b82438c5ef83c3acf4444 Reviewed-by: Olivier Goffart --- src/corelib/kernel/qvariant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 24bf25baea..c3ccc74a20 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2946,7 +2946,7 @@ bool QVariant::convert(int targetTypeId) if (oldValue.isNull()) return false; - if ((QMetaType::typeFlags(d.type) & QMetaType::PointerToQObject) && (QMetaType::typeFlags(targetTypeId) & QMetaType::PointerToQObject)) { + if ((QMetaType::typeFlags(oldValue.userType()) & QMetaType::PointerToQObject) && (QMetaType::typeFlags(targetTypeId) & QMetaType::PointerToQObject)) { create(targetTypeId, &oldValue.d.data.o); return true; }