diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2012-04-18 14:40:50 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-19 01:57:58 +0200 |
commit | b3e55fbf4ec8b260d358640808ea459a5125049b (patch) | |
tree | bbd4720cdff2459f8fd8c1b0f14456faf944042e /src/corelib/kernel/qmetatype_p.h | |
parent | 06d4ea64001f7d7c019f5dac5080d80e37828c3d (diff) |
Do not assert when QVariant is constructed from an invalid type id
That change also fix moduleForType() which was wrongly recognizing
negative ids as belonging to Core.
New tests were added.
Change-Id: I40a5819effb32489a45937011980457387c9f8be
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype_p.h')
-rw-r--r-- | src/corelib/kernel/qmetatype_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h index 2ab4a3896f..985cf71974 100644 --- a/src/corelib/kernel/qmetatype_p.h +++ b/src/corelib/kernel/qmetatype_p.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE namespace QModulesPrivate { enum Names { Core, Gui, Widgets, Unknown, ModulesCount /* ModulesCount has to be at the end */ }; -static inline int moduleForType(const int typeId) +static inline int moduleForType(const uint typeId) { if (typeId <= QMetaType::LastCoreType) return Core; |