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.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 41336a2d2d..9ce12ad1b2 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -314,8 +314,17 @@ class Q_CORE_EXPORT QVariant
void load(QDataStream &ds);
void save(QDataStream &ds) const;
#endif
- static const char *typeToName(int typeId);
- static Type nameToType(const char *name);
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED_VERSION_6_0
+ static const char *typeToName(int typeId)
+ { return QMetaType(typeId).name(); }
+ QT_DEPRECATED_VERSION_6_0
+ static Type nameToType(const char *name)
+ {
+ int metaType = QMetaType::fromName(name).id();
+ return metaType <= int(UserType) ? QVariant::Type(metaType) : UserType;
+ }
+#endif
void *data();
const void *constData() const