Make usage of internal QVariant space.
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>
Wed, 12 Oct 2011 15:32:26 +0000 (17:32 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 9 Nov 2011 09:11:34 +0000 (10:11 +0100)
commit8fd64d22ac7892b061a09c42c72aacf033b80876
tree9c0d04049188ad5ff726419279ee88c3fdd0d1bf
parent2b39be6dd5d111482e5df06ac6dea18ca338d9f0
Make usage of internal QVariant space.

Each QVariant instance has internal storage which may be
used for well-know basic types. This patch changes the
behavior by delegating type dependent operation to QMetaType
class which knows more types than QVariant itself.

The patch significantly reduce amount of code in QVariant
implementation.

There are few side effects of this patch:
- better performance:
* for Core types when using Gui (QGuiVariant is able to
construct Core types)
* for small custom types (QVariant::Private::Data is used for all
types that has size small enough)
- comparing two QVariants can give different result for small custom
types (binary comparison instead of pointer comparison)

Change-Id: Ic17fa500d6a882110bfba896fd456c8e6c7a63a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/kernel/qvariant.cpp
src/corelib/kernel/qvariant.h
src/corelib/kernel/qvariant_p.h
src/gui/kernel/qguivariant.cpp
src/widgets/kernel/qwidgetsvariant.cpp
tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp