diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2013-02-05 15:46:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-08 13:36:14 +0100 |
commit | c6cb4ddbf9401ca430a0c0fb0324040313131658 (patch) | |
tree | b040677b9b51787a021adf07b51ae8f210e45c14 /src/corelib/kernel/qvariant.h | |
parent | f79cc2d66b16af40aef7af1803c3ba50c939b03f (diff) |
qMetaTypeId(): deprecate the dummy parameter.
It was there because of MSVC6 compatibility.
It is not removed, because some code used to do
qMetaTypeId(&myVariable);
This was not a documented feature anyway, so it should not be user
visible.
Change-Id: I55327d7e73e67a6bb741817741d530d5a650291a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 172ce29050..6f212f5000 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -484,7 +484,7 @@ public: template <typename T> inline QVariant qVariantFromValue(const T &t) { - return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t, QTypeInfo<T>::isPointer); + return QVariant(qMetaTypeId<T>(), &t, QTypeInfo<T>::isPointer); } template <> @@ -494,7 +494,7 @@ template <typename T> inline void qVariantSetValue(QVariant &v, const T &t) { //if possible we reuse the current QVariant private - const uint type = qMetaTypeId<T>(reinterpret_cast<T *>(0)); + const uint type = qMetaTypeId<T>(); QVariant::Private &d = v.data_ptr(); if (v.isDetached() && (type == d.type || (type <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) { d.type = type; @@ -568,7 +568,7 @@ namespace QtPrivate { { static T metaType(const QVariant &v) { - const int vid = qMetaTypeId<T>(static_cast<T *>(0)); + const int vid = qMetaTypeId<T>(); if (vid == v.userType()) return *reinterpret_cast<const T *>(v.constData()); if (vid < int(QMetaType::User)) { |