summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qflags
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-1/+1
| | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove handling of missing Q_COMPILER_INITIALIZER_LISTSAllan Sandfeld Jensen2019-05-021-5/+0
| | | | | | Change-Id: Id65b39c787235a051262544932e6717d076f1ea0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove handling of missing Q_COMPILER_CLASS_ENUMAllan Sandfeld Jensen2019-04-061-6/+0
| | | | | Change-Id: I1fd6d601e49e803b4c3308fb0ca41136c628afbc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix odd test in tst_qflagsAllan Sandfeld Jensen2018-10-171-1/+1
| | | | | | | | This test triggered a compiler warning for good reason, it made no sense, trying to change it to what it was probably meant to be. Change-Id: I01a848272b42dae2aaa58a4f5bed998644d864da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Declare the operator| in the Qt namespace for QFlags in that namespacesOlivier Goffart2018-04-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a long overdue change so we don't break ADL of operator|. I think will not break source or binary compatibility. The problem is code like this: namespace Foo { struct MyStruct; MyStruct operator|(MyStruct, MyStruct); void someFunction() { fooLabel->setAlignement(Qt::AlignLeft | Qt::AlignTop) } } This would be an error before as ADL would find only the Foo::operator| and not the global one since the arguments are not in the global namespace. After this change, ADL works fine and this code compiles This bites people with misterious error, see questions on https://stackoverflow.com/questions/10755058/qflags-enum-type-conversion-fails-all-of-a-sudden https://stackoverflow.com/questions/39919142/broken-bitwise-or-operator-in-a-qt-project [ChangeLog][QtCore] QFlags's operator| for enum types in the Qt namespace are now declared in the Qt namespace itself. Change-Id: I021bce11ec1521b4d8795a2cf3084a0be1960804 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: support enum classes in setFlag()Giuseppe D'Angelo2017-11-241-0/+12
| | | | | | | Unary ~ is not defined for enum classes, so we need a cast. Change-Id: I79d495ebcc24ab960da8dae3be08eb307a9de448 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix test build with ICC: QFlags does not auto cast to uintThiago Macieira2017-04-281-9/+9
| | | | | | | | | | I don't know why. tst_qflags.cpp(114): error: no instance of function template "verifyConstExpr" matches the argument list argument types are: (Qt::MouseButton) tst_qflags.cpp(91): note: this candidate was rejected because there is a type mismatch after argument substitution Change-Id: I84e363d735b443cb9beefffd14b9581d77933cb8 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Remove qtypetraits.h's contents altogetherGiuseppe D'Angelo2017-01-121-4/+4
| | | | | | | | | | | | | | | | | So that QFlags can use an (un)signed int matching the underlying type as identified by the compiler and not by us. Requires fixing a few warnings about sign conversion due to QFlags misusages in qtbase that were either plain wrong, or were relying on the enum being backed by an (un)signed int when it wasn't. Keep qtypetraits.h in the source tree in order to prevent source breaks if some downstream #includes it (note however that it did not contain any public API). Change-Id: Ib3a92b98db7031e793a088fb2a3b306eff4d7a3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename QtPrivate::is_[un]signed to QtPrivate::Is[Un]signedEnumKai Koehne2016-11-091-4/+4
| | | | | | | | Any other use than for enums should use std::is_[un]signed. Make this explicit by renaming the type traits. Change-Id: I494158563c95c710e710d0d337f4e547006df171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use qtConfig throughout in qtbaseLars Knoll2016-08-191-2/+2
| | | | | | | | | | | Use the new qtConfig macro in all pro/pri files. This required adding some feature entries, and adding {private,public}Feature to every referenced already existing entry. Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Add setFlag method to QFlagsAndre Somers2016-02-081-0/+14
| | | | | | | | | | | | This makes implementing class methods that enable or disable a feature stored in a QFlags<> member easier. [ChangeLog][QtCore][QFlags] Added setFlag method to set or unset a flag Task-number: QTBUG-27100 Change-Id: Ic602abbbf3100df78f21b7918573744d1bbd18c1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * Use correct test to add C++14 to the project configurationJames McDonnell2015-12-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Only add C++14 to the project configuration when C++14 support is available on the platform. Adding it because the platform supports C++11 doesn't work when the platform _only_ supports C++11 (e.g., QNX 6.6.0). Task-number: QTBUG-49491 Change-Id: I15de38bb06d912a314b9dd18c80b513cc06a855e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+1
| | | | | | | | | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-011-1/+0
|/ | | | | Change-Id: I1955320e7639760b4383a53f37a506c8055933ef Reviewed-by: Liang Qi <liang.qi@theqtcompany.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>
* Use Q_DECL_RELAXED_CONSTEXPR in QFlagsOlivier Goffart2014-10-312-0/+15
| | | | | 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>
* Add support for initializer_list construction in QFlagsAdam Majer2014-07-021-0/+24
| | | | | | | | [ChangeLog][QtCore][QFlags] Added initializer_list constructor Task-number: QTBUG-39786 Change-Id: I36967c67b489c2a893fb031954f46f5243aba2c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QFlags: make constExpr() check compile on clang trunkMarc Mutz2013-11-071-1/+1
| | | | | | | | | | | | | | | | | The problem is the verifyConstExpr<>() line involving the ~ operator. The result as an integer is a value that can no longer be represented in an int. This is known at compile time and thus template deduction, which only has an int to match against, fails. To fix, use an unsigned int as the first template argument of verifyConstExpr<>(). Clang's error message for this is really sub-optimal, cf. http://llvm.org/bugs/show_bug.cgi?id=17834 Change-Id: I3a77dc54d2bee12b016d75724ac1bd7801f4cf2d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make QFlags enum flags (C++11 strict enums) friendlyAlbert Astals Cid2013-05-091-0/+116
| | | | | Change-Id: I9ccb3e4d281a545ca1845db4f6aa7ac6c04e8621 Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* QFlags: use unsigned int when the enum's underlying is unsignedMarc Mutz2012-09-281-2/+16
| | | | | | | | | | | 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>
* 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>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Work around what apparently is a GCC 4.6.0 bugThiago Macieira2012-03-251-1/+1
| | | | | | | | The QFlags::operator int() isn't being called, so GCC complains that this isn't an integer expression. Change-Id: I537d06fd4a52ecbcddf0ef67807b298c42d3e911 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QFlags: mark as Q_PRIMITIVE_TYPEMarc Mutz2012-02-291-0/+9
| | | | | | | | | | | | | | | | | 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>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-111-3/+2
| | | | | | | | | | | | | Tidy the autotest .pro files. Most autotest .pro files should look like this: CONFIG += testcase TARGET = tst_something QT = core testlib SOURCES = tst_something.cpp Change-Id: I877c2194e9fa9dd13478d117895e1e255a948ad7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* corelib: eliminated usage of qttest_p4.prfRohan McGovern2011-10-251-2/+3
| | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Change-Id: I7c1ffe9c8c294dbdc988e1582e580b1ed3f4593e Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Moving relevant tests to corelib/globalHolger Ihrig2011-08-303-0/+133
Task-number: QTBUG-21066 Change-Id: I011e601f599e11365c76598631a443b82ab9fb30 Reviewed-on: http://codereview.qt.nokia.com/3487 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>