summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-02-13 16:26:35 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-02 12:57:29 +0100
commit362bde8e8eef41fc6a338ed8fbe6cbf7e9996019 (patch)
tree96f93a2b19acaba947d13e936f9f6b3cba12d2ff /src/corelib/kernel
parent2b70a7d25c3e73d02d6d14075790668dcfc16e64 (diff)
Introduce QMetaType::UnknownType.
QMetaType::Void was ambiguous, it was pointing to a valid type (void) and in the same time it was signaling errors in QMetaType. There was no clean way to check if returned type was valid void or some unregistered type. This feature will be used by new QMetaObject revision which will store type ids instead of type names. So it will be easy to distinguish between: void mySlot(); MyUnregisteredType mySlot(); Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp36
-rw-r--r--src/corelib/kernel/qmetatype.cpp62
-rw-r--r--src/corelib/kernel/qmetatype.h9
-rw-r--r--src/corelib/kernel/qmetatypeswitcher_p.h7
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/corelib/kernel/qvariant.h2
-rw-r--r--src/corelib/kernel/qvariant_p.h29
7 files changed, 89 insertions, 58 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index b38e7f9004..e446d8b6ba 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1792,14 +1792,14 @@ QByteArray QMetaMethod::name() const
Returns the return type of this method.
The return value is one of the types that are registered
- with QMetaType, or 0 if the type is not registered.
+ with QMetaType, or QMetaType::UnknownType if the type is not registered.
\sa parameterType(), QMetaType, typeName()
*/
int QMetaMethod::returnType() const
{
if (!mobj)
- return 0;
+ return QMetaType::UnknownType;
return QMetaMethodPrivate::get(this)->returnType();
}
@@ -1823,16 +1823,16 @@ int QMetaMethod::parameterCount() const
Returns the type of the parameter at the given \a index.
The return value is one of the types that are registered
- with QMetaType, or 0 if the type is not registered.
+ with QMetaType, or QMetaType::UnknownType if the type is not registered.
\sa parameterCount(), returnType(), QMetaType
*/
int QMetaMethod::parameterType(int index) const
{
if (!mobj || index < 0)
- return 0;
+ return QMetaType::UnknownType;
if (index >= QMetaMethodPrivate::get(this)->parameterCount())
- return 0;
+ return QMetaType::UnknownType;
return QMetaMethodPrivate::get(this)->parameterType(index);
}
@@ -2241,7 +2241,7 @@ bool QMetaMethod::invoke(QObject *object,
for (int i = 1; i < paramCount; ++i) {
types[i] = QMetaType::type(typeNames[i]);
- if (types[i]) {
+ if (types[i] != QMetaType::UnknownType) {
args[i] = QMetaType::create(types[i], param[i]);
++nargs;
} else if (param[i]) {
@@ -2715,11 +2715,11 @@ QVariant::Type QMetaProperty::type() const
uint flags = mobj->d.data[handle + 2];
type = flags >> 24;
}
- if (type)
+ if (type != QMetaType::UnknownType)
return QVariant::Type(type);
if (isEnumType()) {
int enumMetaTypeId = QMetaType::type(qualifiedName(menum));
- if (enumMetaTypeId == 0)
+ if (enumMetaTypeId == QMetaType::UnknownType)
return QVariant::Int;
}
#ifdef QT_COORD_TYPE
@@ -2735,7 +2735,7 @@ QVariant::Type QMetaProperty::type() const
\since 4.2
Returns this property's user type. The return value is one
- of the values that are registered with QMetaType, or 0 if
+ of the values that are registered with QMetaType, or QMetaType::UnknownType if
the type is not registered.
\sa type(), QMetaType, typeName()
@@ -2743,11 +2743,11 @@ QVariant::Type QMetaProperty::type() const
int QMetaProperty::userType() const
{
if (!mobj)
- return 0;
+ return QMetaType::UnknownType;
if (priv(mobj->d.data)->revision >= 7) {
int handle = priv(mobj->d.data)->propertyData + 3*idx;
int type = typeFromTypeInfo(mobj, mobj->d.data[handle + 1]);
- if (type)
+ if (type != QMetaType::UnknownType)
return type;
} else {
QVariant::Type tp = type();
@@ -2756,7 +2756,7 @@ int QMetaProperty::userType() const
}
if (isEnumType()) {
int enumMetaTypeId = QMetaType::type(qualifiedName(menum));
- if (enumMetaTypeId == 0)
+ if (enumMetaTypeId == QMetaType::UnknownType)
return QVariant::Int; // Match behavior of QMetaType::type()
return enumMetaTypeId;
}
@@ -2853,7 +2853,7 @@ QVariant QMetaProperty::read(const QObject *object) const
with QMetaType)
*/
int enumMetaTypeId = QMetaType::type(qualifiedName(menum));
- if (enumMetaTypeId != 0)
+ if (enumMetaTypeId != QMetaType::UnknownType)
t = enumMetaTypeId;
} else {
int handle = priv(mobj->d.data)->propertyData + 3*idx;
@@ -2869,14 +2869,14 @@ QVariant QMetaProperty::read(const QObject *object) const
} else {
uint flags = mobj->d.data[handle + 2];
t = (flags >> 24);
- if (t == QVariant::Invalid) {
+ if (t == QMetaType::UnknownType) {
typeName = legacyString(mobj, mobj->d.data[handle + 1]);
t = QMetaType::type(typeName);
- if (t == QVariant::Invalid)
+ if (t == QMetaType::UnknownType)
t = QVariant::nameToType(typeName);
}
}
- if (t == QVariant::Invalid) {
+ if (t == QMetaType::UnknownType) {
qWarning("QMetaProperty::read: Unable to handle unregistered datatype '%s' for property '%s::%s'", typeName, mobj->className(), name());
return QVariant();
}
@@ -2931,7 +2931,7 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const
return false;
} else if (v.type() != QVariant::Int && v.type() != QVariant::UInt) {
int enumMetaTypeId = QMetaType::type(qualifiedName(menum));
- if ((enumMetaTypeId == 0) || (v.userType() != enumMetaTypeId) || !v.constData())
+ if ((enumMetaTypeId == QMetaType::UnknownType) || (v.userType() != enumMetaTypeId) || !v.constData())
return false;
v = QVariant(*reinterpret_cast<const int *>(v.constData()));
}
@@ -2952,7 +2952,7 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const
t = flags >> 24;
typeName = legacyString(mobj, mobj->d.data[handle + 1]);
}
- if (t == QVariant::Invalid) {
+ if (t == QMetaType::UnknownType) {
const char *typeName = rawStringData(mobj, mobj->d.data[handle + 1]);
const char *vtypeName = value.typeName();
if (vtypeName && strcmp(typeName, vtypeName) == 0)
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 003ad1c32d..6d5973a7d0 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -242,6 +242,7 @@ template<> struct TypeDefinition<QRegExp> { static const bool IsAvailable = fals
\value QEasingCurve QEasingCurve
\value User Base value for user types
+ \value UnknownType This is an invalid type id. It is returned from QMetaType for types that are not registered
\omitvalue FirstGuiType
\omitvalue FirstWidgetsType
@@ -311,7 +312,7 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
QT_FOR_EACH_STATIC_TYPE(QT_ADD_STATIC_METATYPE)
QT_FOR_EACH_STATIC_ALIAS_TYPE(QT_ADD_STATIC_METATYPE_ALIASES_ITER)
QT_FOR_EACH_STATIC_HACKS_TYPE(QT_ADD_STATIC_METATYPE_HACKS_ITER)
- {0, 0, QMetaType::Void}
+ {0, 0, QMetaType::UnknownType}
};
Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeGuiHelper = 0;
@@ -348,10 +349,7 @@ Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock)
void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveOp,
LoadOperator loadOp)
{
- int idx = type(typeName);
- if (!idx)
- return;
- registerStreamOperators(idx, saveOp, loadOp);
+ registerStreamOperators(type(typeName), saveOp, loadOp);
}
/*! \internal
@@ -434,7 +432,7 @@ static int qMetaTypeCustomType_unlocked(const char *typeName, int length)
{
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (!ct)
- return 0;
+ return QMetaType::UnknownType;
for (int v = 0; v < ct->count(); ++v) {
const QCustomTypeInfo &customInfo = ct->at(v);
@@ -445,7 +443,7 @@ static int qMetaTypeCustomType_unlocked(const char *typeName, int length)
return v + QMetaType::User;
}
}
- return 0;
+ return QMetaType::UnknownType;
}
/*! \internal
@@ -488,11 +486,11 @@ int QMetaType::registerType(const char *typeName, Deleter deleter,
int previousSize = 0;
int previousFlags = 0;
- if (!idx) {
+ if (idx == UnknownType) {
QWriteLocker locker(customTypesLock());
idx = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(),
normalizedTypeName.size());
- if (!idx) {
+ if (idx == UnknownType) {
QCustomTypeInfo inf;
inf.typeName = normalizedTypeName;
inf.creator = creator;
@@ -558,12 +556,12 @@ int QMetaType::registerTypedef(const char* typeName, int aliasId)
int idx = qMetaTypeStaticType(normalizedTypeName.constData(),
normalizedTypeName.size());
- if (!idx) {
+ if (idx == UnknownType) {
QWriteLocker locker(customTypesLock());
idx = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(),
normalizedTypeName.size());
- if (!idx) {
+ if (idx == UnknownType) {
QCustomTypeInfo inf;
inf.typeName = normalizedTypeName;
inf.alias = aliasId;
@@ -592,17 +590,20 @@ int QMetaType::registerTypedef(const char* typeName, int aliasId)
*/
bool QMetaType::isRegistered(int type)
{
- if (type >= 0 && type < User) {
- // predefined type
+ // predefined type
+ if ((type >= FirstCoreType && type <= LastCoreType)
+ || (type >= FirstGuiType && type <= LastGuiType)
+ || (type >= FirstWidgetsType && type <= LastWidgetsType)) {
return true;
}
+
QReadLocker locker(customTypesLock());
const QVector<QCustomTypeInfo> * const ct = customTypes();
return ((type >= User) && (ct && ct->count() > type - User) && !ct->at(type - User).typeName.isEmpty());
}
/*!
- Returns a handle to the type called \a typeName, or 0 if there is
+ Returns a handle to the type called \a typeName, or QMetaType::UnknownType if there is
no such type.
\sa isRegistered(), typeName(), Type
@@ -611,17 +612,17 @@ int QMetaType::type(const char *typeName)
{
int length = qstrlen(typeName);
if (!length)
- return 0;
+ return UnknownType;
int type = qMetaTypeStaticType(typeName, length);
- if (!type) {
+ if (type == UnknownType) {
QReadLocker locker(customTypesLock());
type = qMetaTypeCustomType_unlocked(typeName, length);
#ifndef QT_NO_QOBJECT
- if (!type) {
+ if (type == UnknownType) {
const NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName);
type = qMetaTypeStaticType(normalizedTypeName.constData(),
normalizedTypeName.size());
- if (!type) {
+ if (type == UnknownType) {
type = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(),
normalizedTypeName.size());
}
@@ -652,6 +653,7 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
return false;
switch(type) {
+ case QMetaType::UnknownType:
case QMetaType::Void:
case QMetaType::VoidStar:
case QMetaType::QObjectStar:
@@ -857,6 +859,7 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
return false;
switch(type) {
+ case QMetaType::UnknownType:
case QMetaType::Void:
case QMetaType::VoidStar:
case QMetaType::QObjectStar:
@@ -1154,6 +1157,7 @@ void *QMetaType::create(int type, const void *copy)
case QMetaType::QModelIndex:
return new NS(QModelIndex)(*static_cast<const NS(QModelIndex)*>(copy));
#endif
+ case QMetaType::UnknownType:
case QMetaType::Void:
return 0;
default:
@@ -1257,6 +1261,7 @@ void *QMetaType::create(int type, const void *copy)
case QMetaType::QModelIndex:
return new NS(QModelIndex);
#endif
+ case QMetaType::UnknownType:
case QMetaType::Void:
return 0;
default:
@@ -1318,6 +1323,7 @@ public:
template<typename T>
void delegate(const T *where) { DestroyerImpl<T>::Destroy(m_type, const_cast<T*>(where)); }
void delegate(const void *) {}
+ void delegate(const QMetaTypeSwitcher::UnknownType*) {}
void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestroyer(m_type, (void*)where); }
private:
@@ -1380,6 +1386,7 @@ public:
template<typename T>
void *delegate(const T *copy) { return ConstructorImpl<T>::Construct(m_type, m_where, copy); }
void *delegate(const void *) { return m_where; }
+ void *delegate(const QMetaTypeSwitcher::UnknownType*) { return m_where; }
void *delegate(const QMetaTypeSwitcher::NotBuiltinType *copy) { return customTypeConstructor(m_type, m_where, copy); }
private:
@@ -1468,6 +1475,7 @@ public:
template<typename T>
void delegate(const T *where) { DestructorImpl<T>::Destruct(m_type, const_cast<T*>(where)); }
void delegate(const void *) {}
+ void delegate(const QMetaTypeSwitcher::UnknownType*) {}
void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestructor(m_type, (void*)where); }
private:
@@ -1536,6 +1544,7 @@ public:
template<typename T>
int delegate(const T*) { return SizeOfImpl<T>::Size(m_type); }
+ int delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; }
int delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeSizeOf(m_type); }
private:
static int customTypeSizeOf(const int type)
@@ -1606,13 +1615,14 @@ public:
template<typename T>
quint32 delegate(const T*) { return FlagsImpl<T>::Flags(m_type); }
quint32 delegate(const void*) { return 0; }
+ quint32 delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; }
quint32 delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeFlags(m_type); }
private:
const int m_type;
static quint32 customTypeFlags(const int type)
{
const QVector<QCustomTypeInfo> * const ct = customTypes();
- if (Q_UNLIKELY(!ct))
+ if (Q_UNLIKELY(!ct || type < QMetaType::User))
return 0;
QReadLocker locker(customTypesLock());
if (Q_UNLIKELY(ct->count() <= type - QMetaType::User))
@@ -1793,6 +1803,7 @@ public:
template<typename T>
void delegate(const T*) { TypeInfoImpl<T>(m_type, info); }
void delegate(const void*) {}
+ void delegate(const QMetaTypeSwitcher::UnknownType*) {}
void delegate(const QMetaTypeSwitcher::NotBuiltinType*) { customTypeInfo(m_type); }
private:
void customTypeInfo(const uint type)
@@ -1813,7 +1824,7 @@ QMetaType QMetaType::typeInfo(const int type)
{
TypeInfo typeInfo(type);
QMetaTypeSwitcher::switcher<void>(typeInfo, type, 0);
- return typeInfo.info.creator || !type ? QMetaType(QMetaType::NoExtensionFlags
+ return typeInfo.info.creator || type == Void ? QMetaType(QMetaType::NoExtensionFlags
, static_cast<const QMetaTypeInterface *>(0) // typeInfo::info is a temporary variable, we can't return address of it.
, typeInfo.info.creator
, typeInfo.info.deleter
@@ -1824,26 +1835,23 @@ QMetaType QMetaType::typeInfo(const int type)
, typeInfo.info.size
, typeInfo.info.flags
, type)
- : QMetaType(-1);
+ : QMetaType(UnknownType);
}
QMetaType::QMetaType(const int typeId)
: m_typeId(typeId)
{
- if (Q_UNLIKELY(typeId == -1)) {
+ if (Q_UNLIKELY(typeId == UnknownType)) {
// Constructs invalid QMetaType instance.
m_extensionFlags = 0xffffffff;
Q_ASSERT(!isValid());
} else {
// TODO it can be better.
*this = QMetaType::typeInfo(typeId);
- if (m_typeId > 0 && !m_creator) {
+ if (m_typeId == UnknownType)
m_extensionFlags = 0xffffffff;
- m_typeId = -1;
- }
- if (m_typeId == QMetaType::Void) {
+ else if (m_typeId == QMetaType::Void)
m_extensionFlags = CreateEx | DestroyEx | ConstructEx | DestructEx;
- }
}
}
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index beb7294abd..0f069dc45c 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
// F is a tuple: (QMetaType::TypeName, QMetaType::TypeNameID, RealType)
#define QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(F)\
- F(Void, 0, void) \
+ F(Void, 43, void) \
F(Bool, 1, bool) \
F(Int, 2, int) \
F(UInt, 3, uint) \
@@ -192,8 +192,8 @@ public:
// these are merged with QVariant
QT_FOR_EACH_STATIC_TYPE(QT_DEFINE_METATYPE_ID)
- FirstCoreType = Void,
- LastCoreType = QModelIndex,
+ FirstCoreType = Bool,
+ LastCoreType = Void,
FirstGuiType = QFont,
LastGuiType = QPolygonF,
FirstWidgetsType = QIcon,
@@ -202,6 +202,7 @@ public:
QReal = sizeof(qreal) == sizeof(double) ? Double : Float,
+ UnknownType = 0,
User = 256
};
@@ -627,7 +628,7 @@ inline QMetaType::~QMetaType()
inline bool QMetaType::isValid() const
{
- return m_typeId >= 0;
+ return m_typeId != UnknownType;
}
inline bool QMetaType::isRegistered() const
diff --git a/src/corelib/kernel/qmetatypeswitcher_p.h b/src/corelib/kernel/qmetatypeswitcher_p.h
index e9c15ea214..ffd188c972 100644
--- a/src/corelib/kernel/qmetatypeswitcher_p.h
+++ b/src/corelib/kernel/qmetatypeswitcher_p.h
@@ -59,7 +59,8 @@ QT_BEGIN_NAMESPACE
class QMetaTypeSwitcher {
public:
- class NotBuiltinType;
+ class NotBuiltinType; // type is not a built-in type, but it may be a custom type or an unknown type
+ class UnknownType; // type not known to QMetaType system
template<class ReturnType, class DelegateObject>
static ReturnType switcher(DelegateObject &logic, int type, const void *data);
};
@@ -74,7 +75,11 @@ ReturnType QMetaTypeSwitcher::switcher(DelegateObject &logic, int type, const vo
switch (QMetaType::Type(type)) {
QT_FOR_EACH_STATIC_TYPE(QT_METATYPE_SWICHER_CASE)
+ case QMetaType::UnknownType:
+ return logic.delegate(static_cast<UnknownType const *>(data));
default:
+ if (type < QMetaType::User)
+ return logic.delegate(static_cast<UnknownType const *>(data));
return logic.delegate(static_cast<NotBuiltinType const *>(data));
}
}
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 1c18883fde..ae51764c0a 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1697,7 +1697,7 @@ void QVariant::load(QDataStream &s)
QByteArray name;
s >> name;
typeId = QMetaType::type(name);
- if (!typeId) {
+ if (typeId == QMetaType::UnknownType) {
s.setStatus(QDataStream::ReadCorruptData);
return;
}
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 5da482d5cd..4d4b2d51ab 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -126,7 +126,7 @@ class Q_CORE_EXPORT QVariant
{
public:
enum Type {
- Invalid = QMetaType::Void,
+ Invalid = QMetaType::UnknownType,
Bool = QMetaType::Bool,
Int = QMetaType::Int,
UInt = QMetaType::UInt,
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index a754bc4363..b28aaf3c20 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -187,7 +187,11 @@ public:
return FilteredComparator<T>::compare(m_a, m_b);
}
- bool delegate(const void*) { return true; }
+ bool delegate(const void*) { Q_ASSERT(false); return true; }
+ bool delegate(const QMetaTypeSwitcher::UnknownType*)
+ {
+ return true; // for historical reason invalid variant == invalid variant
+ }
bool delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return false; }
protected:
const QVariant::Private *m_a;
@@ -281,7 +285,8 @@ public:
return CallIsNull<T>::isNull(m_d);
}
// we need that as sizof(void) is undefined and it is needed in HasIsNullMethod
- bool delegate(const void *) { return m_d->is_null; }
+ bool delegate(const void *) { Q_ASSERT(false); return m_d->is_null; }
+ bool delegate(const QMetaTypeSwitcher::UnknownType *) { return m_d->is_null; }
bool delegate(const QMetaTypeSwitcher::NotBuiltinType *) { return m_d->is_null; }
protected:
const QVariant::Private *m_d;
@@ -354,8 +359,18 @@ public:
void delegate(const void*)
{
- // QMetaType::Void == QVariant::Invalid, creating an invalid value creates invalid QVariant
- // TODO it might go away, check is needed
+ qWarning("Trying to create a QVariant instance of QMetaType::Void type, an invalid QVariant will be constructed instead");
+ m_x->type = QMetaType::UnknownType;
+ m_x->is_shared = false;
+ m_x->is_null = !m_copy;
+ }
+
+ void delegate(const QMetaTypeSwitcher::UnknownType*)
+ {
+ if (m_x->type != QMetaType::UnknownType) {
+ qWarning("Trying to construct an instance of an invalid type, type id: %i", m_x->type);
+ m_x->type = QMetaType::UnknownType;
+ }
m_x->is_shared = false;
m_x->is_null = !m_copy;
}
@@ -401,7 +416,8 @@ public:
qWarning("Trying to destruct an instance of an invalid type, type id: %i", m_d->type);
}
// Ignore nonconstructible type
- void delegate(const void*) {}
+ void delegate(const QMetaTypeSwitcher::UnknownType*) {}
+ void delegate(const void*) { Q_ASSERT(false); }
private:
QVariant::Private *m_d;
};
@@ -446,10 +462,11 @@ public:
{
qWarning("Trying to stream an instance of an invalid type, type id: %i", m_d->type);
}
- void delegate(const void*)
+ void delegate(const QMetaTypeSwitcher::UnknownType*)
{
m_debugStream.nospace() << "QVariant::Invalid";
}
+ void delegate(const void*) { Q_ASSERT(false); }
private:
QDebug m_debugStream;
QVariant::Private *m_d;