summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qtypeinfo.h
Commit message (Collapse)AuthorAgeFilesLines
* Define QTypeInfo for char16_t, char32_t and wchar_t in Qt 5Thiago Macieira2015-10-231-1/+13
| | | | | | | | | | | | | Commits 0b700fb6f92662adaf632c6e83c12a3751c3174b and 0e4d94edd0caac9d2378a00a0aa961a0be3ad796 defined QTypeInfo for those three only for Qt 6 (and forced C++11 support). Define them in Qt 5, keeping compatibility with QList storage. That is, these types are defined to be primitive and static at the same time, for the benefit of QList. Change-Id: I9cac3a70af156971022c1e6084cb5538c050f826 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Add QTypeInfo::isRelocatableThiago Macieira2015-08-101-12/+49
| | | | | | | | | | It's the same as movable (i.e., the opposite of QTypeInfo::isStatic), except that it won't trigger the QList change in memory layout. For Qt 6, we should merge the two. Change-Id: Ib306f8f647014b399b87ffff13f1ece29e4b6e5c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Introduce Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6Marc Mutz2015-07-181-2/+11
| | | | | | | | | | | | | ... with classical semantics, meaning movable-come-Qt6, and complex-until-then. Whether or not we want a new flag for movable-except- in-QList is an orthogonal question, and should not hold back the slew of commits that introduce use of this macro. Change-Id: I3a6be08c314fcd7f3315af138625c38196debda5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Remove qSwap specialization from Q_DECLARE_SHAREDMarc Mutz2015-01-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The way swapping is supposed to work is: 1. Each type supplies a swap() function or function template in its namespace. Any good STL implementation will find it there through ADL. As will the primary qSwap() template. 2. Each use of swap() in Qt, in particular in template code, should use qSwap() instead of std::swap() or the using+swap-trick, because qSwap() automatically enables ADL. It also has a sophisticated conditional noexcept specification that can be used in the custom swap() functions' own noexcept clause. This change also allows us to convert implicitly-shared classes' member-swap functions to noexcept one at a time, because the specialization will no longer be in conflict with the primary template regarding exception specifications. The primary's specification could, of course, be reused here, but it's complex and if the machinery around it is changed later on, it will not affect Q_DECLARE_SHARED classes. Change-Id: I3389a655a9fd8de370f363c8fcef60269a9f506c Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't specialize std::swap, just overload it in the global namespaceThiago Macieira2015-01-091-8/+3
| | | | | | | | | | | | | | This is the modern, correct way of providing a swap operation. See http://stackoverflow.com/a/8439357/134841 for more information. By changing this, we also fix Qt building with ICC and libc++. This patch also adds a noexcept() rule to match what the C++11 standard requires. Change-Id: I18f22fe7c92cf253e94168e1312346b4c183f536 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Remove QHashDummyNode and avoid undifined behaviorOlivier Goffart2014-07-081-1/+1
| | | | | | | | | | | | | A lot of code in QHash is doing casting to QHashNode while the pointer may be of type QHashDummyNode. This is a lot of undefined behavior. Remove QHashDummyNode and specialize QHashNode for QHashDummyValue instead. QHashDummyValue is the only type for which QTypeInfo::isDummy is true. Q_DUMMY and QTypeInfo::isDummy are internal API, so is QHashDummyNode, so we can remove them. Task-number: QTBUG-40029 Change-Id: I60c2ff0933075b9202bde89a9992746052f75133 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QtPrivate::is_integral instead of listing each integer typeThiago Macieira2014-02-121-26/+24
| | | | | | | | | | | This changes the code added by 0e4d94edd0caac9d2378a00a0aa961a0be3ad796 by removing the Q_INTEGRAL_TYPE enum value and instead relying on our private copy of typetraits. Change-Id: Icb6c814a36125de0d712421b97e11e8abc0f7416 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-101-1/+1
|\ | | | | | | Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
| * don't make msvc see digraphsOswald Buddenhagen2014-01-091-1/+1
| | | | | | | | | | | | | | | | Task-number: QTBUG-35816 Change-Id: I996a86233f771d6a466c5c5eb6116df14cd00dbd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Add QTypeInfo<T>::isIntegral traitThiago Macieira2014-01-091-13/+30
|/ | | | | | | | | | This allows us to know whether a given type is an integer or not. It's going to be useful for QAtomicInteger, to know whether certain operations can be performed on the type. Change-Id: Ie64b24993e4021b44c97952d7d3973759fef3d4c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Doc: Fix spelling errorDebao Zhang2013-06-201-1/+1
| | | | | Change-Id: I9225ffeddfe17bc4f56ecd9a9c4656403840f828 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-3/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix direct compilation of qtypeinfo.h and othersThiago Macieira2012-12-181-2/+2
| | | | | | | | | | | | | | qtypeinfo.h is included by qglobal.h, so it needs to include that before the #ifdef. Otherwise, we get a circular dependency problem with qflags.h: ./QtCore/../../src/corelib/global/qflags.h:60:27: error: "Q_PRIMITIVE_TYPE" has not been declared Also, take the opportunity to fix the other headers that are included from qglobal.h to avoid similar problems in the future. Change-Id: I99a56f42775c24bdcc796995b06509c1ca0cb849 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+1
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Introduce QTypeInfoMerger.Jędrzej Nowacki2012-07-271-0/+32
| | | | | | | | | | | | QTypeInfoMerger class was created to allow "inheriting" QTypeInfo traits. The class implementation was based on the QTypeInfo<QPair<>> specialization, therefore the specialization was refactored to use the new class. Change-Id: I4ff3e5eac1d55da086dad84274cce2b2c0a721be Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q_DECLARE_SHARED: mark the type movableMarc Mutz2012-07-101-0/+1
| | | | | | | | | | All implicitly shared classes are by definition movable, so this patch adds Q_DECLARE_TYPEINFO(Type, Q_MOVABLE_TYPE) to Q_DECLARE_SHARED. Change-Id: Idf8989ae1a7ed6d1ac13fccb7eaef7395a875350 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Q_DECLARE_SHARED: fix docs; require and use member-swapMarc Mutz2012-07-061-5/+5
| | | | | | | | | | | | | | | By requiring a member-swap, this macro becomes applicable to a wider range of types (e.g. QFont, which has another member besides 'd'), while at the same time avoiding the encapsulation leak that is data_ptr(). There have been concerns over breaking existing users of this macro, but for some time now, Q_DECLARE_SHARED only works within QT_BEGIN_NAMESPACE anyway, so its a safe bet that all users of this macro are in-tree. Change-Id: I7fdd9dba204554af8d3f9768b97bb42847a5acf4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove references to QT_NO_STL from QtCoreThiago Macieira2012-04-071-4/+0
| | | | | | | | QT_NO_STL is now no longer defined, so remove the conditionals and select the STL side. Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* QtGlobal: remove qIsDetached()Marc Mutz2012-03-011-4/+0
| | | | | | | | | | | | | | | | | | There's not a single in-tree user of this function, and the concept is a broken one in MT programs: By the time qIsDetached() returns, the result can already be different due to another thread taking a copy, or a copy in another thread being destroyed (note that this doesn't require mutex use by the user, since we promise (implicitly, if not explicitly) that you can copy from const objects without holding a lock). QTBUG-10813 talks about a use in QCache::trim(), but 677cf76340f88e0fe51c1f75aa512b6d835414ca removed it, so there's no reason to keep it anymore. Change-Id: I20380c12bdf00ac764b89d84392f0f34727b1971 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QFlags: mark as Q_PRIMITIVE_TYPEMarc Mutz2012-02-291-0/+4
| | | | | | | | | | | | | | | | | I originally tried to put Q_DECLARE_TYPEINFOs into Q_DECLARE_OPERATORS_FOR_FLAGS, to declare not only the flags type, but also the underlying enum as primitive, but too many users (arguably correctly) used Q_DECLARE_OPERATORS_FOR_FLAGS at (non-global) namespace scope where QTypeInfo would have been specialised in the wrong namespace. So specialise QTypeInfo for QFlags<T> only. Change-Id: I4af6e29aefbd9460a3d2bc6405f03cdf6b1096bc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move QTypeInfo out of qglobal.h and into a separate headerBradley T. Hughes2012-02-201-0/+216
qtypeinfo.h is still included from qglobal.h, and defines QTypeInfo as well as all the specializations for built-in and default Qt types. Change-Id: I24116174de288a730cbb7aa2f80d346d2b2f9408 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>