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/widgets | |
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/widgets')
-rw-r--r-- | src/widgets/kernel/qwidgetsvariant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp index f6817cec8a..15935a5886 100644 --- a/src/widgets/kernel/qwidgetsvariant.cpp +++ b/src/widgets/kernel/qwidgetsvariant.cpp @@ -62,7 +62,8 @@ static void construct(QVariant::Private *x, const void *copy) v_construct<QSizePolicy>(x, copy); break; default: - Q_ASSERT(false); + qWarning("Trying to construct an instance of an invalid type, type id: %i", x->type); + x->type = QVariant::Invalid; return; } x->is_null = !copy; |