summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QVariant: make customConstructShared() SCARY¹Marc Mutz2023-07-131-2/+8
| | | | | | | | | | | | | | | | | | | Extract Method non-template customConstructSharedImpl() to avoid instantiating std::unique_ptr with a different per-F Deleter over and over again. Not picking to 6.5 because the function was confined to the qvariant.cpp TU in those versions. Cf. 11791e2a50417661679f84aeae21ce959cab638f and d783363f60173f1bc6525f1a8bbbd87f1e3afc1d for similar issues. ¹ https://www.open-std.org/jtc1/sc22/WG21/docs/papers/2009/n2911.pdf Pick-to: 6.6 Change-Id: I73d21d929a7db2ab47f62a3246cf913d82e3db75 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant: Extract Method PrivateShared::computeOffset()Fabian Kosmale2023-05-311-1/+6
| | | | | | | | | | | | Will be re-used in the upcoming emplace() function. No attempt is made to re-write the expression to be more readable. That's left for another commit. Task-number: QTBUG-112187 Change-Id: Id391b78f1477c5225beda8a32c4f6c1393dd51bb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QVariant: Extract Method PrivateShared::computeAllocationSize()Fabian Kosmale2023-05-311-1/+7
| | | | | | | | | | Will be re-used in the upcoming emplace() function. Task-number: QTBUG-112187 Change-Id: Ie2b4570b7ba6c9d0ce938203933758a0d0d59f5a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QVariant: Move some inline methods into a private headerUlf Hermann2023-02-221-0/+92
| | | | | | | | | | We want to be able to use those from qtdeclarative. Clearly, they are intended to be inline. Task-number: QTBUG-108789 Change-Id: I3560e9b58213c4f41dbf6553021f3d6187960e8b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove qvariant_p.hThiago Macieira2022-07-271-27/+0
| | | | | Change-Id: I3859764fed084846bcb0fffd1704480153e34973 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
* QVariant: replace v_construct with a Private template constructorThiago Macieira2022-07-271-13/+0
| | | | | | | It's effectively the same and no one is using v_construct(). Change-Id: I3859764fed084846bcb0fffd1704470801c9e6e7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QVariant: Use QMetaTypeInferface directlyFabian Kosmale2021-01-281-1/+1
| | | | | | | | | | | | There is no reason for QVariant to go through QMetaType when it can use the QMetaTypeInterface directly. Without LTO, the QMetaType method calls are opaque, and we therefore risk to lose optimizations. Additionally, avoid constructing a QMetaType from a type id if we already have the QMetaType. Fixes: QTBUG-90673 Change-Id: I7069ff6aff70d5baecdf5cf5760014c3dda81784 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of the private v_cast<>() methodLars Knoll2020-08-241-27/+1
| | | | | | | Replace it with QVariant::Private::get<>(). Change-Id: I801742300d9b15f748bb91fcd6cfa176d2057271 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Use QMetaTypeModuleHelper as the interface to do type conversionsLars Knoll2020-08-241-6/+0
| | | | | | | | | | | | | | Move the type conversions from QVariant::Helper to QMetaType. Only do this for Qt Gui in a first step. This makes it possible to completely remove the Handler struct in QVariant, and now allows QMetaType to also convert Gui types. Moving the conversion of Core types into QMetaType will require further work. Change-Id: I061f789deca1b595d92bb29227eb54b8e71a3ee3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of the unused meta type switcherLars Knoll2020-08-241-2/+0
| | | | | Change-Id: I8771feb68227bf69643b66314284c645cccdec6f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup v_construct and friendsLars Knoll2020-08-241-73/+9
| | | | | | | Streamline code using if constexpr and remove some unused code paths. Change-Id: I602acffab4b3e53fab9e2433856f6b7e8210cc60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup unused codeLars Knoll2020-08-241-5/+0
| | | | | Change-Id: I27821ca7e63fccd5353c48eebfde19756846dd2e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup QVariant::PrivateSharedLars Knoll2020-08-241-18/+7
| | | | | | | | | | | | | Remove the additional indirection through ptr and replace it with an offset calculation. Get rid of PrivateSharedEx that was handling certain types differently. This also fixes the support for overaligned types, by using the alignment field from QMetaType to determine the alignment requirements. Change-Id: Icc6a78eb57f664c7747450578fe58dfee8f2863b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Always use the variants internal space if possibleLars Knoll2020-08-241-2/+1
| | | | | | | | | | There's no point in storing small types with an external refcount, even if they aren't movable. Simply copying the type should be faster in pretty much all cases, while this uses less memory. Change-Id: I127474f8e3c5fa042f530684f9d5bfccbba134ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refactor Q*IterableLars Knoll2020-08-241-2/+1
| | | | | | | | | | | | Refactor the methods retrieving data in Q*Iterable so that we don't return pointers with unclear ownership. Instead, copy the data into a out pointer provided by the caller. This also means there is no need for the metatype flags anymore and we can remove those. Change-Id: I517de23a8ccfd608585ca00403aca0df2955f14b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Get rid of the custom debug stream handling in QVariantLars Knoll2020-08-241-50/+0
| | | | | | | | Use the builtin support in QMetaType instead. Change-Id: Ifc0e88719a384aa7fb525652bada22b6f7ee1c45 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Restrict QVariant::isNull() behaviorLars Knoll2020-08-131-119/+0
| | | | | | | | | | | | | | | | | | | | | isNull() would forward to the contained type and check that type's isNull() method for some of the builtin types. Remove that behavior and only return true in isNull(), if the variant is invalid, doesn't contain data or contains a null pointer. In addition, implement more consistent behavior when constructing a QVariant using the internal API taking a copy from a void *. isNull() should return true in both cases. This mainly changes behavior for some corner cases and when using our internal API. [ChangeLog][Important Behavior Changes] QVariant::isNull() no longer returns true when the variant contains an object of some type with an isNull() method, that returns true for the object; QVariant::isNull() now only returns true when the variant contains no object or a null pointer. Change-Id: I3125041c4f8f8618a04aa375aa0a56b19c02dcf5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use the new support for comparisons in QMetaType for QVariantLars Knoll2020-08-131-43/+0
| | | | | | | | | | | | | | Remove the compare method in the QVariant::Handler struct. Rely on the generic support provided by QMetaType instead. [ChangeLog][Important Behavior Changes][QVariant] QVariant will now use builtin support in QMetaType to compare its content. This implies a behavioral change for some graphical types like QPixmap, QImage and QIcon that will never compare equal in Qt 6 (as they do not have a comparison operator). Change-Id: I30a6e7116c89124d11ed9052537cecc23f78116e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-11/+11
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use the new QMetaType API in QVariantOlivier Goffart2020-02-251-108/+1
| | | | | Change-Id: I5495ee1159864ebd64083fadbfac7e07177ed406 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QVariant: introduce ShouldDeleteVariantData flagFabian Kosmale2019-12-111-0/+5
| | | | | | | | | | | | | | | | This flag is used in QSequentialIterable and QAssociativeIterable to indicate that the data pointer in VariantData should be deleted after the variant has been constructed. The use case for this is https://codereview.qt-project.org/c/qt/qtdeclarative/+/284151, where we have a proxy iterator and cannot easily return a pointer to already owned data, as it is hard to manage its lifetime in the iterator. In contrast, it is clear that we can release the memory in the QSequentialIterable functions, as it has already been copied into the QVariant there. Change-Id: I2b33497d991cd4f752153e0ebda767b82e4bb851 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* More nullptr usage in headersKevin Funk2019-03-141-5/+5
| | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace Q_DECL_FINAL with finalKevin Funk2017-09-221-3/+3
| | | | | | | | | | | | | | | Remaining uses of Q_DECL_FINAL are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp (definition and documentation of Q_DECL_FINAL) src/tools/moc/moc.cpp tests/auto/tools/moc/ (supported for moc for Q_DECL_FINAL) Change-Id: I0d28946c9c3f9d37d0b303db86079129014de1f3 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QVariants of null pointers should be nullAllan Sandfeld Jensen2017-08-041-0/+10
| | | | | | | | | | | Changes the QVariant::isNull() implementation for pointer types so they return true if null. [ChangeLog][QVariant] QVariants containing pointers will now return true on isNull() if the contained pointer is null. Change-Id: I8aa0dab482403837073fb2f376a46126cc3bc6b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant of nullptr should always be nullAllan Sandfeld Jensen2017-01-251-1/+21
| | | | | | | | | Implements isNull for QVariants of a nullptr so they always return true to isNull(), instead of depending on how they were constructed. Task-number: QTBUG-58296 Change-Id: Ibddec795cdadedef7e17d22c265c29e752d8f99f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Remove compiler-specific implementations of Q_IS_ENUMKai Koehne2016-11-091-1/+1
| | | | | | | | | | | Since the macro is now just a wrapper for std::is_enum, its use is also deprecated. [ChangeLog][QtCore][Global] Q_IS_ENUM is deprecated. Use std::is_enum<>::value instead. Change-Id: I09b9f4559c02c81f338cace927873318f2acafde Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace custom type traits with std one'sKai Koehne2016-11-081-5/+5
| | | | | | | | | | | | | | | | | | Remove most type traits from qtypetraits.h, but keep the custom implementation of is_signed/is_unsigned. This gets rid of BSD-3 licensed code from Google in a public header (hugh!). The custom implementations for is_signed/is_unsigned are kept because the implementations in gcc's standard headers do not work as we expect for enums - both is_signed and is_unsigned always returns false there - see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027 [ChangeLog][QtCore][General] Qt now relies on type traits from the C++ standard library. Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-211-47/+39
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| * Fix GCC 6 warning about placement-new operator on too little spaceThiago Macieira2016-01-121-18/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 6 is able to detect when you use a placement new of an object in a space that is too small to contain it. qvariant_p.h: In instantiation of ‘void v_construct(QVariant::Private*, const T&) [with T = QRectF]’: qvariant_p.h:142:9: error: placement new constructing an object of type ‘QRectF’ and size ‘32’ in a region of type ‘void*’ and size ‘8’ [-Werror=placement-new] new (&x->data.ptr) T(t); ^~~~~~~~~~~~~~~~~~~~~~~ This happens even for the false branch of a constant expression (the enum). So split the v_construct function in two pairs, one pair for being able to use the internal space and one pair not so. Change-Id: Ibc83b9f7e3bc4962ae35ffff1425ed898f279dea Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * QVariant: use v_construct instead of duplicating logicThiago Macieira2016-01-121-31/+4
| | | | | | | | | | | | | | | | | | v_construct does what we want, so use it. This is required for the next commit, which solves a GCC 6 warning issue. Change-Id: Ibc83b9f7e3bc4962ae35ffff1425ed5f035f631a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * QVariant: make sure to default-initialize in v_constructThiago Macieira2016-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | Otherwise it's possible to get garbage for primitive types (trivially constructible) under some conditions. Change-Id: I408dcb81ba654c929f25ffff142885fc62395948 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QVariantIsNull: remove the non-C++11 implementationOlivier Goffart2015-11-161-39/+0
|/ | | | | | | | decltype is required now Change-Id: I69173127bd35f1d29945c8cfa47e1fbf1479c14d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Use QTypeInfo<T>::isRelocatable in QVariantThiago Macieira2015-09-241-1/+1
| | | | | Change-Id: Ib306f8f647014b399b87ffff13f1f01c40dc3ef7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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>
* QVariant: attempt to work around an ICE on linux-arm-gnueabi-g++ (Ubuntu ↵Marc Mutz2015-01-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 11.10) with constexpr QSizePolicy This is the error: src/corelib/kernel/qvariant_p.h: In constructor ‘QVariantPrivateSharedEx<T>::QVariantPrivateSharedEx() [with T = QSizePolicy]’: src/corelib/kernel/qvariant_p.h:107:61: internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:3560 There are two things fishy in this file: 1. Use of the unnamed namespace in a file that gets included in different libraries. While not technically undefined behavior, it may become so when used in the implementation, which it is. 2. Missing explicit initialization of a member of QVariantPrivateSharedEx. This is just a wild guess, because the ICE happens in that line. That class itself is quite smelly, because the address of an object is taken before the lifetime of the object begins. A fix would be to store the object in a wrapper class from which QVPSEx inherits _first_, but then a cast from QVPSEx to QVariant::PrivateShared would require pointer adjustments, and I didn't look through all the code to determine whether that would be an issue. Having been bitten by this sometime ago: https://marcmutz.wordpress.com/private-practice/private-practice-taming-templates/#edit-20111128 I opted to do these easy changes first to see whether they already fix the ICE. Change-Id: Ic15fd928b3dff2318c425c915b2dab5e54254d71 Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Make use of the internal space for enum in QVariantOlivier Goffart2013-11-081-1/+1
| | | | | | | | Enums are movable even if they have not been tagged as such, and therefore can safely make use of the internal storage. Change-Id: I3bec8556bfeb4a07cb30d918f8d1dd2565d6d94a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix compilation with ICC 13.1: the MSVC 2005 & 2008 code is badThiago Macieira2013-06-261-1/+1
| | | | | | | | | qvariant_p.h(226): error: name followed by "::" must be a class or namespace name template<class C> static Yes test(char (*)[(&C::isNull == 0) + 1]); ^ Change-Id: I42eef44d46ca0fb7aac8f82150e917c4fb912b15 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.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>
* 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>
* QtGlobal: remove Q_DECL_FINAL_CLASSMarc Mutz2012-08-261-3/+3
| | | | | | | | | | | Now that qvariant_p.h's HasIsNullMethod check is fixed so that it doesn't require Q_COMPILER_DECLTYPE anymore to be able to deal with final classes, there's no point in distinguishing Q_DECL_FINAL and Q_DECL_FINAL_CLASS anymore, so remove the latter. Change-Id: I31de5b63e7d2e44171a13e928997c946d93e05c9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QVariant: make the HasIsNullMethod check work across all compilers (maybe)Marc Mutz2012-08-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we have a C++11 version that requires Q_COMPILER_DECLTYPE support, and can deal with final classes, and a C++98 version that doesn't require any C++11 features, but fails on final classes. What we're missing is a version that works for MSVC v8 and v9 (2005 and 2008), which sport the 'sealed' non-standard keywords but lack decltype support. So far, we tried to solve the problem by making class-level final special (Q_DECL_FINAL_CLASS), not defining that macro for these two compilers, even though we did define Q_DECL_FINAL, the method-level keyword. This new formulation, taken from http://stackoverflow.com/a/9655327/134841 supposedly supports all compilers with a minor #ifdef for MSVC which doesn't like applying sizeof() the way we do. However, testing has shown this to blow up on OSX. So we use the less intrusive approach: add this variant as a third version, only used by VC 2005 and 2008. Change-Id: If1945f8a6e9ed36cb68212fa781d5e29eb2a082d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-101-0/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * Fix "unused variable" warning in QVariant header.Morten Sorvig2012-03-301-0/+1
| | | | | | | | | | Change-Id: Ia70ee372e277b1f95b893c461820fe97f381b8b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Crash fix in ~QVariantJędrzej Nowacki2012-03-211-1/+0
| | | | | | | | | | | | | | | | QVariant handlers can not be unregistered. We are not able to guarantee that such operation is safe and we do not want to. Change-Id: Id9a12e6a8c750110e4a08eab1de3e07e5c408675 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove a dead code from QVariant.Jędrzej Nowacki2012-03-191-9/+26
| | | | | | | | | | | | | | Remove some "safety" code, but essentially it was a dead code. Change-Id: Ie19c29d4cce8b72be5dbaca53c03adc63e8c3dc5 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>