summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement QVariant to QDebug streaming.Jędrzej Nowacki2012-01-101-0/+51
| | | | | | | New implementation fixes some commented code marked as FIXME. Change-Id: If8f5bebedd65bcf8f839d804c2022ca79ef82ddf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Refactor QVariant handlers.Jędrzej Nowacki2012-01-041-43/+11
| | | | | | | | | | | | | | | | | | | | | | | | | QVariant implementation is based on delegation to a handler. The handler has rather simple construction, it is a set of function that implements a switch statement over known types and redirects calls to a right method of an encapsulated types instance. Unfortunately after qt modularization project, it is not easy to use types directly from different modules, as they can be undefined or completely unaccessible. Which means that each module has to implement own handler to cooperate correctly with QVariant. We can suspect that list of modules known to QVariant will grow and it is not limited to GUI, Widgets and Core, therefore it would be nice to have an unified, from performance and source code point of view, way of working with handlers. This patch is an attempt to cleanup handlers. Keynotes: - Each handler is working only on types defined in the same module - Core handler implements handling of primitive types too - Custom types have an own handler - Each handler is independent which means that dispatch between handlers is done on QVariant level - Handlers might be registered / unregistered using same interface Change-Id: Ib096df65e2c4ce464bc7a684aade5af7d1264c24 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fixed static assert in qvariant template magicDenis Dzyubenko2012-01-041-1/+1
| | | | | | | | | CallConstructor<T, /* CanUseInternalSpace = */ false> is called when we need to construct an object that couldn't be fit in qvariantdata, meaning either it is not a POD type (Q_PRIMITIVE_TYPE), or it is simply too large to fit there. Change-Id: Ied122b4a6f600e14312a8d515f5b3e91214a94f1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix movablity of QVariant.Jędrzej Nowacki2011-12-221-24/+35
| | | | | | | | | | | | | | | | After 8fd64d22ac7892b061a09c42c72aacf033b80876 (Make usage of internal QVariant space.) change QVariant started to "inherit" movablity from interned type. This change fix it by interning only movable type in QVariant and by using external allocation for not movable ones. Obviously, this change has negative impact on QVariant it self, but after it, QVariant will behave a lot nicer with our containers. Change-Id: Ibffc95833918f65be737f52d694ee81a2036c412 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant: Fix MSVC compiler warning about unused variable null.Friedemann Kleint2011-11-091-2/+1
| | | | | | | | | Use static method isnull(). Introduced by ca26fefc0624264262a2abe630568271cefa2753. Change-Id: I752f8d8a5ec473dcc5f50fbda47d061b8d3a7e13 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* [optimization] QVariants comparisonJędrzej Nowacki2011-11-091-2/+2
| | | | | | | | | | | QMetaType::isRegistered and QMetaType::typeName are quite expensive. To compare two custom objects we need to have their type name (for dereferenced comparison). If the name exist we know for sure that the type is registered and we do not have to call QMetaType::isRegistered anymore. Change-Id: Iba631e012504c8633868a902880fa30d38afb917 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make usage of internal QVariant space.Jędrzej Nowacki2011-11-091-0/+292
| | | | | | | | | | | | | | | | | | | | | | 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>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+153
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12