summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qvariant.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 5754af42ac..816c34a14d 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2974,7 +2974,8 @@ bool QVariant::convert(int targetTypeId)
}
bool isOk = true;
- if (!handlerManager[d.type]->convert(&oldValue.d, targetTypeId, data(), &isOk))
+ int converterType = std::max(oldValue.userType(), targetTypeId);
+ if (!handlerManager[converterType]->convert(&oldValue.d, targetTypeId, data(), &isOk))
isOk = false;
d.is_null = !isOk;
return isOk;