From 4b8ceb41aed352f10d36db5284453f425dbc5f3f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 30 Dec 2011 12:00:09 +0100 Subject: Store the is-a QObject fact with the metatype declaration. This is a source incompatible change for Q_DECLARE_METATYPE(T*), which now requires T to be fully defined. The consequences of this are: * Forward declared types can no longer be declared as a metatype. (though this is a very uncommon thing to do). There is a trivial workaround where necessary. Change-Id: Id74c40088b8c0b466fcd7c55abd616f69acc82c8 Reviewed-by: Lars Knoll --- src/corelib/kernel/qmetatype.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qmetatype.cpp') diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 44fa450f5f..1c106f4f36 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1670,11 +1670,13 @@ class Flags template::IsAccepted> struct FlagsImpl { - static quint32 Flags(const int) + static quint32 Flags(const int type) { return (!QTypeInfo::isStatic * QMetaType::MovableType) | (QTypeInfo::isComplex * QMetaType::NeedsConstruction) - | (QTypeInfo::isComplex * QMetaType::NeedsDestruction); + | (QTypeInfo::isComplex * QMetaType::NeedsDestruction) + | (type == QMetaType::QObjectStar ? QMetaType::PointerToQObject : 0) + | (type == QMetaType::QWidgetStar ? QMetaType::PointerToQObject : 0); } }; template -- cgit v1.2.3