Make sure that unknown types use the handler for unknown types.
authorStephen Kelly <stephen.kelly@kdab.com>
Tue, 24 Jul 2012 10:34:33 +0000 (12:34 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 24 Jul 2012 22:48:28 +0000 (00:48 +0200)
This fixes an assert in the QVariant checkDataStream unit test when
it no longer links to QtGui.

Change-Id: Ib45139cf790f3ac6ee80e1c59f50d08d0b51ffa4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
src/corelib/kernel/qmetatype_p.h

index 126acde..a2e6839 100644 (file)
@@ -64,9 +64,9 @@ static inline int moduleForType(const uint typeId)
 {
     if (typeId <= QMetaType::LastCoreType)
         return Core;
-    if (typeId <= QMetaType::LastGuiType)
+    if (typeId >= QMetaType::FirstGuiType && typeId <= QMetaType::LastGuiType)
         return Gui;
-    if (typeId <= QMetaType::LastWidgetsType)
+    if (typeId >= QMetaType::FirstWidgetsType && typeId <= QMetaType::LastWidgetsType)
         return Widgets;
     return Unknown;
 }