summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qflags.h
Commit message (Collapse)AuthorAgeFilesLines
* QtCore: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-011-1/+1
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I0cc388ef9faf45cbcf425ad0dc77db3060c104a8 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>
* QFlags: plaster API with Q_DECL_NOTHROWMarc Mutz2015-01-051-36/+37
| | | | | | | | | | | | Yes, this is necessary. The noexcept operator looks for noexcept tagging, not at the contents of the function to determine whether to return true. The more conditionally-noexcept functions are used, the more important it becomes that low-level classes are correctly marked noexcept. In that, it is like constexpr. Change-Id: Ia1aebf9b8d73fd8164c10dfca27a710934ba79a8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use Q_DECL_RELAXED_CONSTEXPR in QFlagsOlivier Goffart2014-10-311-7/+7
| | | | | Change-Id: I91073f4bb71e554402fc13cbd0e9ba5b5b95bce0 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>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-101-6/+15
|\ | | | | | | Change-Id: Ia12ffdb27ecdf25c2a2bdb0eed1945387502108a
| * Attempt to work with Visual Studio in -Za (strict ANSI) modeThiago Macieira2014-07-051-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Visual Studio always treats enum values as signed int, even when the value doesn't fit in a signed int (like 0x80000000 or larger than 32- the tags themselves are still signed. That causes ambiguity in creating a QFlag from an enum value. Visual C++ defines __STDC__ in C mode, but we have no macro in C++ mode. Also note that the Windows SDK headers don't compile in -Za mode. Task-number: QTBUG-39700 Change-Id: Ia943cef37ac1f539bd461c3c18200b0c365c72b3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Add support for initializer_list construction in QFlagsAdam Majer2014-07-021-0/+17
|/ | | | | | | | [ChangeLog][QtCore][QFlags] Added initializer_list constructor Task-number: QTBUG-39786 Change-Id: I36967c67b489c2a893fb031954f46f5243aba2c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add other integer overloads to QFlag's constructorThiago Macieira2014-02-011-3/+9
| | | | | | | | | | | | This avoids "change of sign" warnings as found by ICC when the high bit is set. This often happens when you do X & ~Y as ~Y probably has bit 31 on. If the enum is unsigned, then there's a sign conversion. Change-Id: Ia5f221d928ac0155f4504a70c4046e60c25fbf3b Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q(UrlTwo)Flags: avoid undefined behaviorMarc Mutz2013-11-071-8/+8
| | | | | | | | | | | | | | Loading an enum with a value that isn't in the enum is undefined, according to Clang's usan. So when doing logical operations on QFlags<E>, don't go through the QFlags(E) constructor, but via QFlags(QFlag) (=int) instead. Apply the same change to QUrlTwoFlags. Change-Id: I5f27e22c4d831482fcbba88b97cb124fb005e3fd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QFlags enum flags (C++11 strict enums) friendlyAlbert Astals Cid2013-05-091-7/+8
| | | | | Change-Id: I9ccb3e4d281a545ca1845db4f6aa7ac6c04e8621 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QFlags: Remove text promising 64 bit enums for 5.1Kai Koehne2013-04-281-1/+1
| | | | | Change-Id: I34173abd693cb124beb8feec5e0cee1f7842725e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+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>
* Replace macro qdoc with Q_QDOCDebao Zhang2013-01-081-2/+2
| | | | | | | | Both qdoc and Q_QDOC are used in source code, which looks not good. Change-Id: I4f3a71670278b0758d92bfa5db086a07e1b1acfd Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix direct compilation of qtypeinfo.h and othersThiago Macieira2012-12-181-1/+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>
* QFlags: use unsigned int when the enum's underlying is unsignedMarc Mutz2012-09-281-3/+13
| | | | | | | | | | | Replace storage and operator int() return types with unsigned int if the enum is unsigned. This fixes a number of exisiting warnings, in particular with Qt::MouseButton under GCC. Change-Id: Ia12d36212329aec3e9d62a5fbd38809a6c2b36d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: fail for 64-bit enumsMarc Mutz2012-09-271-0/+3
| | | | | | | | An int is not enough to hold all values of a 64-bit enum, so don't allow to compile QFlags for such enums. Change-Id: Ia291c4a5e2160dfd6d5a35e61a7f71ab571b9d9a Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* QFlags: don't provide a constructor from void**Marc Mutz2012-09-221-1/+2
| | | | | | | | | | | | | | | | Use a pointer-to-member instead of void** for Zero, the type that is used to accept only a literal 0, but not other ints, as QFlags ctor arguments. This was developed while trying to find the cause for a build failure in the qCompare<QIcon> specialisation after adding underlying-enum detection to QFlags, and it didn't help, but I think it's a saver alternative to void**, in particular since the ctor in question is implicit. Change-Id: I71c67b0b50e9404e4e42836d09d62663296f58af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Mark the QFlag and QIncompatibleFlag as primitive.Stephen Kelly2012-07-281-0/+3
| | | | | | Change-Id: I7dab4d029e7840fe4778a750a8dd7367675d7a27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: complete constexpr'ifcationMarc Mutz2012-07-211-4/+4
| | | | | | Change-Id: Ie7c33bc1e3abaa9100093a84e65bee5f3b80fe0f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make the QIncompatibleFlag constexpr.Stephen Kelly2012-07-181-3/+3
| | | | | | Change-Id: If99b43b45cc667449dbe7c487b56885c6ce9b1c7 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use Q_DECL_CONSTEXPR for the QFlag's inline constructorLaszlo Papp2012-07-101-2/+2
| | | | | Change-Id: I8f9c7bf0fddb79c6c0937e415c427a0547a5cab0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove Q_CORE_EXPORT from the simple QFlag and QIncompatibleFlagThiago Macieira2012-04-131-2/+2
| | | | | Change-Id: I0302238e817fc7d3b4682c5cc4f9cb51d181a7d2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move QFlags to qflags.hThiago Macieira2012-04-131-0/+139
This is a verbatim copy of the source code. Change-Id: I1f7efc75cad1ba05dda31d8ccfd091ae9ae40fd5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>