summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetatype.h30
-rw-r--r--src/corelib/kernel/qvariant.h6
-rw-r--r--src/dbus/qdbusreply.h2
3 files changed, 19 insertions, 19 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 76cee612ce..e4f1052673 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -631,30 +631,30 @@ void qRegisterMetaTypeStreamOperators(const char *typeName
#endif // QT_NO_DATASTREAM
template <typename T>
-inline Q_DECL_CONSTEXPR int qMetaTypeId(
-#ifndef Q_QDOC
- T * /* dummy */ = 0
-#endif
-)
+inline Q_DECL_CONSTEXPR int qMetaTypeId()
{
Q_STATIC_ASSERT_X(QMetaTypeId2<T>::Defined, "Type is not registered, please use the Q_DECLARE_METATYPE macro to make it known to Qt's meta-object system");
return QMetaTypeId2<T>::qt_metatype_id();
}
template <typename T>
-inline Q_DECL_CONSTEXPR int qRegisterMetaType(
-#if !defined(Q_QDOC) && !defined(Q_CC_SUN)
- T * dummy = 0
-#endif
-)
+inline Q_DECL_CONSTEXPR int qRegisterMetaType()
{
-#ifdef Q_CC_SUN
- return qMetaTypeId(static_cast<T *>(0));
-#else
- return qMetaTypeId(dummy);
-#endif
+ return qMetaTypeId<T>();
}
+#if QT_DEPRECATED_SINCE(5, 1) && !defined(Q_QDOC)
+// There used to be a T *dummy = 0 argument in Qt 4.0 to support MSVC6
+template <typename T>
+QT_DEPRECATED inline Q_DECL_CONSTEXPR int qMetaTypeId(T *)
+{ return qMetaTypeId<T>(); }
+#ifndef Q_CC_SUN
+template <typename T>
+QT_DEPRECATED inline Q_DECL_CONSTEXPR int qRegisterMetaType(T *)
+{ return qRegisterMetaType<T>(); }
+#endif
+#endif
+
template <typename T>
struct QMetaTypeIdQObject<T*, /* isPointerToTypeDerivedFromQObject */ true>
{
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)) {
diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h
index 1d73e61cc4..7b4a4ebcf8 100644
--- a/src/dbus/qdbusreply.h
+++ b/src/dbus/qdbusreply.h
@@ -69,7 +69,7 @@ public:
}
inline QDBusReply& operator=(const QDBusMessage &reply)
{
- QVariant data(qMetaTypeId(&m_data), reinterpret_cast<void*>(0));
+ QVariant data(qMetaTypeId<Type>(), reinterpret_cast<void*>(0));
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<Type>(data);
return *this;