summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qmap
Commit message (Collapse)AuthorAgeFilesLines
* QMap: add missing qHash() overloadMarc Mutz2024-02-091-0/+6
| | | | | | | | | | | | | | | | | | | Found in API review, but not deemed important enough to still get into 6.7. Not implementing it for QMultiMap, because there we need to mod out order of equivalent elements. The GHS compiler acted up and tried to compile the noexcept specification, hitting non-existing qHash(QVariant) for QVariantMap and producing a hard error instead of SFINAE'ing out. As a work-around, establish an artificial SFINAE-friendly context, but only for that compiler. [ChangeLog][QtCore][QMap/QHash] Added qHash() overload for QMap. Change-Id: Ia7dbf488e8e5490962118e40581b7c4cc8ed95e5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Check that QMulti{Map,Hash} (still) store in reverse insertion orderMarc Mutz2023-12-071-0/+24
| | | | | | | | | It's wrong, but let's not break it unconsciously. Pick-to: 6.6 6.5 Change-Id: Ic3daa7df4db2ef34ff5d08fddecf9a932ad92156 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* CMake: Make corelib tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I28b6d3815c5f43d2c33ea65764f6f3f8f129eaf3 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-171-2/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tst_QMap: remove unused std::as_const cloneMarc Mutz2022-11-181-6/+0
| | | | | | | | Amends d273076b4474bb473d90e996960c4c773745761a. Pick-to: 6.4 6.2 Change-Id: Icfff438223ed10756f15e25ea52cccdf93dd47a2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QMap: avoid tripping MSVC debug-mode iterator assertionsThiago Macieira2022-08-281-1/+6
| | | | | | | | | It does a check to ensure you aren't comparing outside the container. Fixes: QTBUG-106001 Pick-to: 6.2 6.3 6.4 Change-Id: Ic6547f8247454b47baa8fffd170eef346b7f4f24 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* tst_qmap: port away from deprecated APIsIvan Solovev2022-08-271-70/+110
| | | | | | | | | | | | | | The most common changes are: * removing the explicit tests for deprecated APIs * QMultiMap::insertMulti() -> QMultiMap::insert() * QMultiMap::insert(QMultiMap) -> QMultiMap::unite(QMultiMap) Add separate tests for the deprecated APIs, and guard them with QT_DEPRECATED_SINCE() checks. Task-number: QTBUG-104858 Change-Id: Ifb79212d07f20028d93d75f2b32ec3785cc93b22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | 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>
* Add qt_internal_undefine_global_definition functionAlexey Edelev2022-02-021-2/+1
| | | | | | | | | | | | | | | | qt_internal_undefine_global_definition disables an internal global definition that is defined by the qt_internal_add_global_definition function for a specific target. Remove the ability to set the custom "undefine" flag for the definitions since it's hard to control it using the introduced function. Pick-to: 6.2 6.3 Task-number: QTBUG-100334 Change-Id: Ic1637d97aa51bbdd06c5b191c57a941aa208d4dc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Restore missing Qt definitionsAlexey Edelev2022-01-311-2/+3
| | | | | | | | | | | | | | | | | Restore the 'QT_NO_JAVA_STYLE_ITERATORS' and 'QT_NO_NARROWING_CONVERSIONS_IN_CONNECT' definitions for Qt targets. Add the function that adds global definitions for Qt targets according to the provided scope and the target property-based switch to disable the definition for a specific target. Pick-to: 6.2 6.3 Task-number: QTBUG-100295 Change-Id: I28697e81f9aabc45c48d79aae1e5caea141e04e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QMap: add operator+ and - for iteratorsGiuseppe D'Angelo2021-07-271-0/+46
| | | | | | | | | | | | | We missed the chance of deprecating them in 5.15, so they'll just add to the pain of porting to 6.0. We should not keep them around forever, though; QMap isn't random access and so its iterators should only have bidirectional APIs. Pick-to: 6.2 Fixes: QTBUG-95334 Change-Id: I3577f7d25e8ab793722d2f220fd27bc85c622b0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMultiMap: extend unit testsIvan Solovev2021-07-161-143/+581
| | | | | | | | | | | | | Extend tests to explicitly check the behavior of empty default-constructed container. Also add some missing tests to increase the code coverage. Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: Ib3c3f5bcb967cd1031cb24ffceaa77a146212ffd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QMap: extend unit testsIvan Solovev2021-07-151-4/+301
| | | | | | | | | | | | Extend tests to explicitly check the behavior of empty default-constructed container. Also add some missing tests to increase the code coverage. Task-number: QTBUG-91736 Pick-to: 6.2 6.1 Change-Id: I5b418265fc7cb3e56e44782be7704d642923a8e9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-121-12/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-6/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-232-2/+2
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMultiMap: fix remove(Key, T) when key/value belong to the mapGiuseppe D'Angelo2020-08-191-0/+171
| | | | | | | | | | | | | | Just like any other container, it's legitimate for the user to pass key/values belonging to the same container. Q(Multi)Map::remove(Key) are already safe (either they call erase() directly on std::(multi)map, where it does the right thing, or they skip elements while detaching). However, QMultiMap::remove(Key, T) wasn't safe in this regard (the implementation is hand rolled), so take copies before start erasing. Change-Id: I87767d608b83216a6ff264fb6c8f145fdb5934f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMap: fix insert() rvalue overloadsGiuseppe D'Angelo2020-08-061-0/+97
| | | | | | | | Receiving an rvalue still requires to check whether the parameter is detached, otherwise we can't steal its backing std::map. Change-Id: Ie88dbf39fd777112ad7bb20a46d5c2d65be8eb3d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-061-38/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Disable deprecation warnings in some testsTor Arne Vestbø2020-07-291-0/+1
| | | | | | | | The tests are testing deprecated functionality, which we still want to test. Change-Id: Iad6ed35800896170c17fe019c7a6ecda22398ac3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-092-2/+2
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-03-041-0/+6
|\ | | | | | | Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
| * Add operator-> to the key-value iterator for QHash and QMapIvan Čukić2020-03-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the arrow operator to the stl-like key-value iterator (QKeyValueIterator) for QMap and QHash. This allows using normal member access syntax it->first and it->second instead of having to use (*it).first and (*it).second. [ChangeLog][QtCore][Containers] Added operator-> to the key-value iterator for QHash/QMap. Change-Id: I9cfa6480784ebce147fcfbf37fec5ad0080e2899 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* | Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-0/+96
|\ \ | | | | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-01-041-0/+96
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
| | * Add QMap::insert(const QMap &map)Mårten Nordheim2019-12-121-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | As opposed to unite(), this inserts one map into the other without duplicating elements. Task-number: QTBUG-35544 Change-Id: Ie8ab350b29148851a3176cef1007e8a4ca82c273 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-191-73/+9
|\| | | | | | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * | Get rid of QT_STRICT_ITERATORSLars Knoll2019-11-041-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The concept was a nice idea to avoid accidental detach() calls in implicitly shared containers, but it conflicts with a C++11 compatible API for them, with signatures for modifying methods taking a const_iterator as argument and returning an iterator (e.g. iterator erase(const_iterator)). Change-Id: Ia33124bedbd260774a0a66f49aedd84e19c9971b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Get rid of unsharable containersLars Knoll2019-10-301-63/+0
| |/ | | | | | | | | | | | | | | The support for unsharable containers has been deprecated since Qt 5.3.0, so let's finally remove support for them. Change-Id: I9be31f55208ae4750e8020b10b6e4ad7e8fb3e0e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate tests/auto/corelib/toolsAlexandru Croitor2019-11-122-1/+24
| | | | | | | | | | | | | | Change-Id: I1ea8fbf509c7e6d556ebd974fcff9084bc668e17 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-0/+2
|\| | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of itMarc Mutz2019-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | ... except for tests, which manually undefine the macro. Like QT_NO_FOREACH, this is a technical way to keep JSI-free modules JSI-free going forward. Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-06-031-4/+0
|\| | | | | | | | | | | Take 5. Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
| * Remove handling of missing Q_COMPILER_INITIALIZER_LISTSAllan Sandfeld Jensen2019-05-021-4/+0
| | | | | | | | | | | | Change-Id: Id65b39c787235a051262544932e6717d076f1ea0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+1
|/ | | | | | | | | | | | | | | Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* Implement key-value iteratorSamuel Gaist2017-05-051-0/+54
| | | | | | | | | | | | | This patch implements an iterator that returns a pair containing both the key and the value of an entry in QHash/QMap. [ChangeLog][QtCore][Containers] Added an stl-like iterator to go through QHash/QMap returning both the key and the value of the element pointed to. That lets QHash/QMap interoperate better with stl's algorithms like std::set_union. Change-Id: Idbf8a8581510b3493648c34ab04c556de9fa4aa7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMap, QHash: make key_iterator satisfy the DefaultConstructible conceptAnton Kudryavtsev2017-03-201-0/+4
| | | | | Change-Id: Ifc3f481ddb902b26c217516412c93a4a39a32b1c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| * Fix Clang -Wexpansion-to-defined warning by deprecating QT_SUPPORTSThiago Macieira2016-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The C and C++ standards say it's undefined whether the preprocessor supports macros that expand to defined() will operate as an ifdef. Clang 3.9 started complaining about that fact. One solution was to change QT_SUPPORTS to check for zero or one, which means we need to change the #defines QT_NO_xxx to #define QT_NO_xxx 1. The C standard says we don't need to #define to 0, as an unknown token is interpreted as zero. However, that might produce a warning (GCC with -Wundef), so changing the macro this way is not recommended. Instead, we deprecate the macro and replace the uses with #ifdef/ndef. Change-Id: Id75834dab9ed466e94c7ffff1444874d5680b96a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* | tests/auto/corelib: Remove some placeholder formatting.Friedemann Kleint2015-10-221-1/+1
| | | | | | | | | | | | | | | | Use QByteArray/QString addition instead in loops and for test row names. Change-Id: Ieffb429efdc14aa5932b3fcdef5a18e13a62d35f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Tests: Use QCOMPARE() with QLatin1String() for QString values.Friedemann Kleint2015-10-141-34/+34
| | | | | | | | | | | | | | Prefer QCOMPARE over QVERIFY for equality and use QLatin1String(). Change-Id: If226a0fc7b25be3e6774c7e36ca1e6f99234e5dd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.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>