summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r--src/corelib/kernel/qvariant.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 9ce12ad1b2..48ea3a9a03 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -249,8 +249,18 @@ class Q_CORE_EXPORT QVariant
const char *typeName() const;
QMetaType metaType() const;
- bool canConvert(int targetTypeId) const;
- bool convert(int targetTypeId);
+ bool canConvert(QMetaType targetType) const
+ { return QMetaType::canConvert(d.type(), targetType); }
+ bool convert(QMetaType type);
+
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED_VERSION_6_0
+ bool canConvert(int targetTypeId) const
+ { return QMetaType::canConvert(d.type(), QMetaType(targetTypeId)); }
+ QT_DEPRECATED_VERSION_6_0
+ bool convert(int targetTypeId)
+ { return convert(QMetaType(targetTypeId)); }
+#endif
inline bool isValid() const;
bool isNull() const;
@@ -376,7 +386,7 @@ class Q_CORE_EXPORT QVariant
template<typename T>
bool canConvert() const
- { return canConvert(qMetaTypeId<T>()); }
+ { return canConvert(QMetaType::fromType<T>()); }
public:
struct PrivateShared