QMetaObject: fix check for void's metatype in metaType()
Pointer comparison is not sufficient on most platforms. Change-Id: I6f936da6f6e84d649f70fffd1706f8b1f0654a1e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
a4e0f070ae
commit
777c7a2288
@ -6,6 +6,7 @@
|
||||
#include "qmetatype.h"
|
||||
#include "qobject.h"
|
||||
#include "qmetaobject_p.h"
|
||||
#include "qmetatype_p.h"
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qcoreevent.h>
|
||||
@ -405,7 +406,7 @@ QMetaType QMetaObject::metaType() const
|
||||
data:QMetaType(prop0), ..., QMetaType(propPropCount-1), QMetaType(class),...
|
||||
*/
|
||||
auto iface = this->d.metaTypes[d->propertyCount];
|
||||
if (iface == QtPrivate::qMetaTypeInterfaceForType<void>())
|
||||
if (iface && QtMetaTypePrivate::isInterfaceFor<void>(iface))
|
||||
return QMetaType(); // return invalid meta-type for namespaces
|
||||
if (iface)
|
||||
return QMetaType(iface);
|
||||
|
Loading…
Reference in New Issue
Block a user