#endif // QT_NO_DATASTREAM
template <typename T>
-inline int qMetaTypeId( T * /* dummy */ = Q_NULLPTR)
+inline int qMetaTypeId()
{
return QMetaTypeId2<T>::qt_metatype_id();
}
template <typename T>
inline int qRegisterMetaType(T * dummy = Q_NULLPTR)
{
- return qMetaTypeId(dummy);
+ return qMetaTypeId<T>();
}
#ifndef QT_NO_DATASTREAM
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 <>
inline void qVariantSetValue(QVariant &v, const T &t)
{
//if possible we reuse the current QVariant private
- const int type = qMetaTypeId<T>(reinterpret_cast<T *>(0));
+ const int type = qMetaTypeId<T>();
QVariant::Private &d = v.data_ptr();
if (v.isDetached() && (type == d.type || (type <= QVariant::Char && d.type <= QVariant::Char))) {
d.type = type;
#ifndef QT_MOC
template<typename T> inline T qvariant_cast(const QVariant &v)
{
- const int vid = qMetaTypeId<T>(static_cast<T *>(Q_NULLPTR));
+ const int vid = qMetaTypeId<T>();
if (vid == v.userType())
return *reinterpret_cast<const T *>(v.constData());
if (vid < int(QMetaType::User)) {
{ arg >> *t; }
template<typename T>
-int qDBusRegisterMetaType(T * /* dummy */ = Q_NULLPTR)
+int qDBusRegisterMetaType()
{
void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>;
void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>;
}
inline QDBusReply& operator=(const QDBusMessage &reply)
{
- QVariant data(qMetaTypeId(&m_data), reinterpret_cast<void*>(0));
+ QVariant data(qMetaTypeId<T>(), reinterpret_cast<void*>(0));
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<Type>(data);
return *this;
template<> inline QDBusReply<QVariant>&
QDBusReply<QVariant>::operator=(const QDBusMessage &reply)
{
- void *null = 0;
+ void *null = Q_NULLPTR;
QVariant data(qMetaTypeId<QDBusVariant>(), null);
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<QDBusVariant>(data).variant();