diff options
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index e6262124fb..a0bbcc235e 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -3052,6 +3052,9 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject) */ bool QVariant::canConvert(int targetTypeId) const { + if (d.type == targetTypeId) + return true; + if ((targetTypeId == QMetaType::QModelIndex && d.type == QMetaType::QPersistentModelIndex) || (targetTypeId == QMetaType::QPersistentModelIndex && d.type == QMetaType::QModelIndex)) return true; |