summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce QHashSeed and switch to size_t seedsThiago Macieira2021-05-234-0/+242
| | | | | | | | | | | Commit 37e0953613ef9a3db137bc8d3076441d9ae317d9 added a to-do, but we can actually change the type, since we've documented since Qt 5.10 that setting a non-zero value (aside from -1) with qSetGlobalQHashSeed was not allowed. Storing a value to be reset later is simply not supported. Change-Id: Id2983978ad544ff79911fffd1671f7b5de284bab Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* tst_QSharedPointer: Fix Clang warnings about self assignmentTor Arne Vestbø2021-05-191-0/+7
| | | | | Change-Id: I32feb86eee5f15e6ec0f0e6fb6811648b172fe7e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QArrayData: store the right flag type, not an intGiuseppe D'Angelo2021-05-171-1/+1
| | | | | | | | There's no reason to be storing `int` in the array data header and then using it as a QFlags. Just store the QFlags. Change-Id: I78f489550d74d15a560dacf338110d80a7ddfdd2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix comparison between nullptr and QWeakPointerVille Voutilainen2021-04-281-0/+15
| | | | | | | | | | | | | | | | | The comparison between nullptr and QWeakPointer was just bogus and ill-formed. The INTEGRITY compiler catches that even if nothing tries to use the comparison. It is an ill-formed, no diagnostic required case of a function template never being able to produce a valid specialization. And while we're at it, this patch makes the result of comparing a nullptr to a QWeakPointer or vice versa the same as asking .isNull() from the weak pointer, because it seems mind-boggling if those are not the same operation. Task-number: QTBUG-93093 Change-Id: I0cc80e795c9af2be1b76de05157aa458ef260f2e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add more tests for QList/QString/QBAAndrei Golubev2021-04-271-27/+357
| | | | | | | | | | | | | | | | The major part is stability tests for QList operations, Also added std::shared_ptr to the Custom type. shared_ptr accesses the memory which does not directly belong to QList, so using it inside a passed-to-qlist type is beneficial (e.g. ASan could catch extra issues) Basic prepend-aware cases added to QString/QBA tests Task-number: QTBUG-93019 Change-Id: I50e742bdf10ea9de2de66539a7dbb9abc4352f82 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit adb41bbe00b2b853d4dd26cd9ee77ae5ed541576) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add tests for QtPrivate::q_relocate_overlap_nAndrei Golubev2021-04-271-0/+281
| | | | | | | | | | | | | | | Test the relocation logic through the QADP::relocate() method which basically calls q_relocate_overlap_n inside and then ensures that the data pointers are in good state Running these locally in fact revealed a bug in the implementation, so these tests are definitely good to have Task-number: QTBUG-93019 Change-Id: I353ed46a31c5c77cd0c5fcacd3dfce46e5cf3e67 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 65d0f6829cc124f6d0d4003a17bedcb74dddf33b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Resurrect data moves in QListAndrei Golubev2021-04-272-16/+59
| | | | | | | | | | | | | | | | | Use the data moves to readjust the free space in the QList, which ultimately fixes the out-of-memory issues caused by cases like: forever { list.prepend(list.back()); list.removeLast(); } Task-number: QTBUG-91801 Task-number: QTBUG-91360 Task-number: QTBUG-93019 Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9)
* Resurrect tests for QSharedPointerVille Voutilainen2021-04-273-3/+16
| | | | | | Task-number: QTBUG-93093 Change-Id: I030c18db1ab9e48cbd3339bc2040ba0b46cd1370 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port of QTimeLine to new property systemAndreas Buhr2021-04-262-14/+290
| | | | | | | | | | | | | The six properties duration, updateInterval, currentTime, direction, loopCount and easingCurve have been ported to the new property system and are now bindable. Drive-by renamed a local variable to avoid shadowing. Task-number: QTBUG-85520 Change-Id: Ibabf106f5200d2dd4329a1e1f96112eccc29d6b1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Inline test cases in tst_qlistAndrei Golubev2021-04-171-598/+157
| | | | | | | | | | | | QList tests have mostly a scheme of: void opInt() { op<int>(); } void opMovable() { op<Movable>(); } void opCustom() { op<Custom>(); } As a drive by, move the leak checking into a separate struct/macro Change-Id: I7cdda3a6c2aa324968aa26594da9f9eafbd49a0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix gcc warnings from having only one of assignment/copyVolker Hilsheimer2021-04-113-0/+5
| | | | | | | | | | | For example: warning: implicitly-declared ‘constexpr Complex& Complex::operator=(const Complex&)’ is deprecated [-Wdeprecated-copy] Pick-to: 6.1 Change-Id: I7598e821acb7cb7bf17776d693af62778185afc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: Satisfy contiguous_range requirementsFabian Kosmale2021-04-061-0/+20
| | | | | | | | | | | | | | | | | | With C++20, there is a new iterator_category: contiguous_iterator, for containers whose elements are stored contiguously in memory. In Qt 6, QList satisfies this requirement. However, we still need to tell the standard machinery about it. Step one is to mark the iterators as contiguous_iterator; as that exists only in C++20, we have to ifdef accordingly. We also have to ensure that the iterators satisfy pointer_traits by defining element_type due to how contiguous_range is specified. As this runs afoul of LWG 3346, we check for known bad _GLIBCXX_RELEASE versions. Change-Id: I8c134544e694ba937e4d912393eb72fa75b49e3d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Rename QList test to something meaningfulAndrei Golubev2021-03-181-2/+2
| | | | | | | qtbug_xxxxx is a fairly ambiguous test name Change-Id: I4b407160464c9b8300d3683549b0ede837161e7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QMultiHash::count(key) crashAndrei Golubev2021-03-121-0/+15
| | | | | | | | | | | As QMultiHash uses a pointer for the data, nullptr dereference is a thing, so check for valid d before doing anything in count() Fixes: QTBUG-91704 Pick-to: 6.0 6.1 Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCommandLineParser: fix crash if there's no QCoreApplicationDavid Faure2021-03-011-0/+29
| | | | | | | | It'll display <executable_name> instead in the help output. Fixes: QTBUG-91430 Change-Id: Ib6211b24cdaa4683a4f62c90b5a1a20ba69f1cff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add more support for structured bindingsGiuseppe D'Angelo2021-02-252-0/+46
| | | | | | | | | | | | | | | | | | | | | | | After QPoint(F), it's now the time of QSize(F) and QVectorND, which can be unambiguously decomposed. [ChangeLog][QtCore][QSize] QSize is now usable in a structured binding declaration. [ChangeLog][QtCore][QSizeF] QSizeF is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector2D] QVector2D is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector3D] QVector3D is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector4D] QVector4D is now usable in a structured binding declaration. Change-Id: I67bb152f4210f2be27607179cd2ec522174cc483 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Disable warnings from using deprecated QScopedPointer::takeVolker Hilsheimer2021-02-131-0/+6
| | | | | | | | It's the QScopedPointer test, so we want to test deprecated APIs. Change-Id: I029103b3150c576cba9b395aafc571b9fccc914a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Restore pre-Qt6 QList::fill() behaviorAndrei Golubev2021-02-101-7/+63
| | | | | | | | | | | | | | | | | | Somehow QList::fill(t, newSize) introduced a regression in Qt6: when newSize < QList::size() we should resize to the newSize. This is aligned with QVector::fill() in 5.15 and std::vector::assign() While 6.0 is already out, picking it to 6.0.x could save someone who haven't migrated yet as well as fix some accidental bugs in Qt's code [ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in 6.0: calling fill() with size < current list size wouldn't truncate the list Fixes: QTBUG-91042 Pick-to: 6.0 6.1 Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Purge various BLACKLIST entries that are now fixedEdward Welbourne2021-02-021-3/+0
| | | | | | | | | | | | | Based on BPASS results from recent test-runs. Task-number: QTBUG-69131 Fixes: QTBUG-87416 Fixes: QTBUG-87662 Task-number: QTBUG-87663 Fixes: QTBUG-88705 Change-Id: I8ebe014517bfa8d124e86b821650b07c591ea16e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Extend alignment of QArrayData to std::max_align_t in allocationAndrei Golubev2021-01-261-1/+29
| | | | | | | | | | | | | | | | | | | | Make stricter alignment requirements for the allocated header This strict alignment allows reallocateUnaligned() to property account for the padding occurring in cases when alignof(QArrayData) < alignof(T) <= alignof(std::max_align_t), which happens to be the case on e.g. 32-bit platforms with specific alignment requirements. This adds 4 bytes (the difference between alignof(std::max_align_t) and sizeof(QArrayData)) of overhead for QString, QByteArray and certain QLists on 32-bit systems. Task-number: QTBUG-90359 Pick-to: 6.0 Change-Id: I8176a4cc79f100ee772b09425e88fe8ff3ae226a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QCache: when overwriting, store the new cost instead of the deltaMårten Nordheim2021-01-141-0/+14
| | | | | | | | | | | The delta was clearly intended to be used on the total (and still is) but it also wound up getting stored in the cache, which wouldn't be a big problem unless the object was removed, in which case we could incidentally 'free up more space' than intended. Pick-to: 6.0 Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-125-99/+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-0746-280/+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>
* tst_qarraydata: blacklist dataPointerAllocate on all 32bit systemsSamuli Piippo2021-01-071-1/+1
| | | | | | | | The test case fails also on QEMU ARMv7. Task-number: QTBUG-88705 Change-Id: Ibe8c777f0205b298f6b9a27c067dd552253fcf33 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix QMultiHash::equal_range crashesZhang Yu2021-01-061-0/+7
| | | | | | | | | | | | QMultiHash::equal_range crashes when called in a const member function. The Data `d` is a NULL pointer when calling equal_range() before inserting data into an empty QMultiHash. Then calling`d->find` crashes. Fixes: QTBUG-89687 Pick-to: 6.0 Change-Id: I10c3d196cbc72aed8c8c922ef16534bba51037b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Change QLineF::setLength() to work whenever length() is non-zeroEdward Welbourne2021-01-051-7/+7
| | | | | | | | | | | | | | | | Previously it only worked when isNull() was false, which is true for very short lines, even though length() may be non-zero. [ChangeLog][QtCore][QLineF] QLineF::setLength() will now set the length if the line's length() is non-zero. Previously, it was documented to only set the length if isNull() was false; this is a fuzzy check, so isNull() could be true for a line with non-zero length(). Fixes: QTBUG-89569 Pick-to: 6.0 5.15 Change-Id: I803e622ad09c85815dde25df8dd3ba6dfcba0714 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-2241-41/+54
| | | | | | | | | | | 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>
* Fix crash on reallocateAndGrowMichal Klocek2020-12-211-0/+57
| | | | | | | | | | | | | | | | | | After 6be398 few tests fail/crash with qtcharts. Fix issue on reallocateAndGraw and avoid accessing flags on invalid header. Data::allocate can return invalid header and dataptr, which takes place if capacity is 0. In code before 6be398 clone method checks if header is not null before resetting flags. However after b76fbb4 resetting flags is no longer needed since it is done in allocateGrow. Task-number: QTBUG-89092 Pick-to: 6.0 Change-Id: I2fde781dad7a0694a5f17ab716f647c2e35f4ff0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QCache: fix updating entries breaking the internal chainMårten Nordheim2020-12-161-0/+17
| | | | | | | | | | | | | | After f08492c6fd9818c7d80b1725355453e179b4d85b was merged this bug would manifest as an entry appearing twice in the chain when a updating an existing entry (insert with an existing key). This could sometimes result in crashes later as the list filled up and the list was used in trim() to remove various entries. Fixes: QTBUG-89176 Pick-to: 6.0 Change-Id: Ide80160fb4317dc0aefe79eec5dce7ec6813e790 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-101-0/+3
| | | | | | | | | And fix up some wrong qmake project files Pick-to: 6.0 Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tst_containerapisymmetry: fix typoGiuseppe D'Angelo2020-12-031-1/+1
| | | | | Change-Id: I9fd5c982a72cd4483108293667b2ae60f7b82ce7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Associative containers: add erase_ifGiuseppe D'Angelo2020-12-021-0/+67
| | | | | | | | | | | | | | | | | | | | Use a trick similar to the one we use for their ranged constructors: support predicates that either take a container's iterator, or that take a std::pair (for STL compatibility). [ChangeLog][QtCore][QMap] Added removeIf() and erase_if(). [ChangeLog][QtCore][QMultiMap] Added removeIf() and erase_if(). [ChangeLog][QtCore][QHash] Added removeIf() and erase_if(). [ChangeLog][QtCore][QMultiHash] Added removeIf() and erase_if(). Change-Id: Ie40aadf6217d7a4126a626c390d530812ebcf020 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSet: add insert(T&&)Mårten Nordheim2020-12-022-5/+79
| | | | | | | | | | | | | | We already have all we need in QHash to support this, so the addition is simple enough. Add test checking how many copies and/or moves are needed for a single insert. As a drive-by: remove some unneeded static_cast Change-Id: Iaf768657644afa45f78f5c81ffcf89ba9607be96 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tests for the new erase/erase_if for sequential containersGiuseppe D'Angelo2020-12-012-0/+90
| | | | | | Change-Id: I3bac5f6f04f3028fbc21f1b4b15b00252a7accb1 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_containerapisymmetry: use an algorithmGiuseppe D'Angelo2020-12-011-3/+3
| | | | | | | | In preparation for the next changes. Change-Id: Ibe0635dfa040842073749aa3e2ae140f27dc983a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDuplicateTracker: add testsMårten Nordheim2020-12-016-0/+211
| | | | | | | | | | It didn't initially have tests. To avoid relying on realizing breakage implicitly through other classes we'll just add tests instead. Task-number: QTBUG-88183 Pick-to: 6.0 Change-Id: I7449dc1f9a118d4b7a8158a2c34563dbd9c43c66 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QHash: support std::hash as hashing functionGiuseppe D'Angelo2020-11-301-0/+86
| | | | | | | | | | | | | | | | | | | | In addition (and as a fallback) from requiring qHash, add support for std::hash specializations. This catches two birds with one stone: 1) users of Qt can simply specialize std::hash for their datatypes, and use them in both QHash and stdlib unordered associative containers; 2) we get QHash support for any (stdlib) datatype that is hashable without having to overload qHash for them. [ChangeLog][QtCore][QHash] QHash, QMultiHash and QSet now support for key types anything that can be hashed via std::hash, instead of always requiring a qHash() overload. Change-Id: Ib5ecba86e4b376d318389500bd24883ac6534c5f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-305-5/+5
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QVLA: do not include QtTestGiuseppe D'Angelo2020-11-251-1/+1
| | | | | | | | The right include is QTest, QtTest drags in all of QtCore. Change-Id: Icc2964ccdb85fe1bfc9fe8f43351a4605a34329b Pick-to: 6.0 5.15 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMessageAuthenticationCode: extend testsIvan Solovev2020-11-241-0/+61
| | | | | | | | | | - Add test for static hash() method - Add tests for addData() overloads - Add input data for sha384 and sha512 Task-number: QTBUG-88183 Change-Id: I7e16419b3a582468fd1de15613e1157af428bc4c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QMargins(F): add support for structured bindingGiuseppe D'Angelo2020-11-221-0/+56
| | | | | | | | | | | [ChangeLog][QtCore][QMargins] QMargins is usable in a structured binding. [ChangeLog][QtCore][QMarginsF] QMarginsF is usable in a structured binding. Change-Id: I0c501847b9377c47bd0e63da3735792075bd0079 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: exclude qarraydata::dataPointerAllocate() from CI testsAssam Boudjelthia2020-11-201-0/+3
| | | | | | | | Task-number: QTBUG-88705 Task-number: QTBUG-87025 Pick-to: 6.0 Change-Id: If2dc0e650e5104d00a097e6195dd117d6cfd64e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Extend tests for QMarginsIvan Solovev2020-11-201-0/+38
| | | | | | | | | - Add check for QT_NO_DATASTREAM macro - Add tests for QDebug operator<< Task-number: QTBUG-88183 Change-Id: I346777a3237986f7f950f157e50cae846b077e11 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QPoint(F): add support for structured bindingGiuseppe D'Angelo2020-11-202-0/+119
| | | | | | | | | | | | | | | QPoint(F) are "naturally" destructurable in their x/y counterparts (hello Mac/Carbon users, we don't live in 1999 any more, it's x and then y, and not vice versa...). [ChangeLog][QtCore][QPoint] QPoint is usable in a structured binding. [ChangeLog][QtCore][QPointF] QPointF is usable in a structured binding. Change-Id: I8718a4e80be4ce03f37f012034f1fba009304b32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QScopedSharedPointerGiuseppe D'Angelo2020-11-201-2/+0
| | | | | | | It's private and unused since ~2012. Change-Id: Iea11af27f7eebf3eae2467b22b68cd4c26885edd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the iterator from QTypedArrayData to QListLars Knoll2020-11-171-2/+2
| | | | | | | | | | The low level implementation does not use it at all, so there's no point having the iterator in QTypedArrayData. Having it in QList removes and indirection and will lead to clearer error messages. Change-Id: I4af270c3cdb39620e5e52e835eb8fe1aa659e038 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Clean up QList(iterator, iterator)Lars Knoll2020-11-171-1/+1
| | | | | | | | | | Fold the two overloads into one, and distinguish the cases using if constexpr. Do not overload QArrayOps::copyAppend(), to make it clear which one is being used. Change-Id: If6a894841aacb84ba190fb2209246f5f61034b42 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix signature of QArrayDataOps::erase()Lars Knoll2020-11-172-2/+2
| | | | | | | | | | | | Bring it in line with the other methods that also take a pointer and a size. Also use truncate() in removeAll() as that's more efficient for the use case. Change-Id: Ib1073b7c048ceb96fb6391b308ef8feb77896866 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the special code for emplaceFront/Back againLars Knoll2020-11-171-3/+4
| | | | | | | | | emplace() itself now handles those cases fast enough, so there should not be a need to add special code paths for those methods. Change-Id: I3277eb77dd54194e46f96f24de44d7785a6f860a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up emplace implementationsLars Knoll2020-11-171-154/+0
| | | | | | | | | | | Avoid duplicated code paths for GrowsForward vs GrowsBackward. Special case emplaceing at the beginning or end of the awrray where we can avoid creating a temporary copy. Change-Id: I2218ffd8d38cfa22e8faca75ebeadb79a682d3cf Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>