QVariant::canConvert: Use the old type when checking for QObject* conversion.

Change-Id: I8450c74ecfdeee96e73b82438c5ef83c3acf4444
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Stephen Kelly 2013-09-05 10:35:36 +02:00 committed by The Qt Project
parent e9a69c3ba9
commit cc594d2064

View File

@ -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;
}