summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary ; after function implementationsLars Schmertmann2020-07-065-36/+36
| | | | | | Task-number: QTBUG-82978 Change-Id: Iea3bcaec1ef9f4bd0f73e5dccca33354650f5bf4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Refactor tst_CollectionsLars Schmertmann2020-07-061-20/+50
| | | | | | | | | | | | | | This improves the readability and avoids code duplication in tst_Collections::forwardDeclared. Also some warnings are fixed: * qSort is deprecated. * The = operator for LargeStatic needs to be implemented explicitly when a copy constructor is given. * QMap::insertMulti is deprecated, a MultiMap is required. Task-number: QTBUG-82978 Change-Id: I577f851394edfaa30154bd3417ce391635cc546d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Avoid use of Q_UNUSED by eliminating the parameter namesLars Schmertmann2020-07-036-25/+22
| | | | | | | | | This change only happens to files touched by the commit to add missing ; to Q_UNUSED. Task-number: QTBUG-82978 Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove deprecated empty macroLars Schmertmann2020-07-021-1/+0
| | | | | Change-Id: Ib2a646ee22a7f97dae584e6f068f17378fe2b494 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Make feature datetimeparser depend on feature datestringEdward Welbourne2020-07-025-30/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | No client of QDateTimeParser actually uses it unless datestring was enabled, nor is it any use without datestring. Various methods conditioned on datestring are broken unless datetimeparser is enabled. We can't condition public API on datetimeparser, as it's a private feature, but client code can condition use of it on the private feature. All string-to-date/time conversions that use a string format (this includes all locale-specific formats) depend on feature datetimeparser. Change #if-ery (or add it) in all client (including test) code to test the right feature. Tidied up some code in the process. Killed some already-redundant textdate #if-ery. Renamed a test whose name claimed it involved locale, which it doesn't, in the course of #if-ing it. This simplifies the condition for feature datetimeedit (which overtly depended on textdate, redundantly since it depends on datestring which depends on textdate; its dependence on datetimeparser now makes its dependency on datestring also redundant). It also removes the need for assorted datestring checks in QDateTimeParser itself. Change-Id: I5dfe3a977042134b2cfb16cbcc795070634e7adf Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update tests/auto/corelib/time/'s CMake configEdward Welbourne2020-07-025-1/+15
| | | | | | | | | Recent changes in .pro files hadn't been propagated. Re-ran pro2cmake.py and saved the results. Change-Id: I91e4cd513329bce10ce8cbd0ddae8240af050213 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove assortee pre-Qt6 code from date/time testsEdward Welbourne2020-07-023-147/+0
| | | | | | | | Assume QT_VERSION >= QT_VERSION_CHECK(6,0,0) throughout. Change-Id: If70c59f9319f72549de581fc446fd60d32b02521 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Introduce platform API abstraction for QOpenGLContextTor Arne Vestbø2020-07-024-35/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is available by including qopenglcontext.h as usual, but scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QCocoaGLContext::fromNative(nsContext, shareContext); b) Access to underlying native handles, e.g. openGLContext->platformInterface<QCocoaGLContext>->nativeContext() c) Platform specific functionality, e.g. static QWGLContext::openGLModuleHandle() openGLContext->platformInterface<QEGLContext>->doSomething(); The platform interfaces live close to the classes they extend, removing the need for complex indirection and plumbing, and avoids kitchen-sink modules and APIs such as the extras modules, QPlatformFunctions, or QPlatformNativeInterface. In the case of QOpenGLContext these platform APIs are backed by the platform plugin, so dynamic_cast is used to ensure the platform plugin supports the requested interface, but this is and implementation detail. The interface APIs are agnostic to where the implementation lives, while still being available to the user as part of the APIs they extend/augment. The documentation will be restored when the dust settles. Task-number: QTBUG-80233 Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QTabBar: make sure the tab is repainted after releasing mouseWang Chuan2020-07-021-0/+38
| | | | | | | | | | | | | | The tab has to be repainted even f the mouse release event happened outside the tab bar, otherwise it will look like the tab is still pressed. As a drive-by, replace the repaint() call with update(); there is no need for synchronous painting in an event handler. Pick-to: 5.15 Fixes: QTBUG-81637 Change-Id: Ia55182be906511ac3b462f00add8a621c6c05fc3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace a constant with a predicate function using itEdward Welbourne2020-07-011-6/+8
| | | | | | | | | | Rather than naming a "GMT" string so as to repeatedly test whether a date-time's string representation ends in it, use a simple lambda to do the test, so that the string is only used in one place anyway. Makes the test code more readable. Change-Id: I5afad9ad5d58702bea7f24e5e5688ea4d738ae0d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Skip / ignore failing tests on CMake platformsAlexandru Croitor2020-07-0113-4/+126
| | | | | | | | | | | | | Skip crashing tests and ignore failing tests on CMake platforms. Add missing QTEST_ENVIRONMENT=ci env var assignment to Coin test instructions. This was hardcoded by the Coin code for qmake configurations. Task-number: QTBUG-85364 Change-Id: Id2312e504a0d36b8f8596d4cebaa49c63731406e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix delivery of MouseMove events to newly opened popup windowsVolker Hilsheimer2020-07-011-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | Amend d934fd7f54eae24ea3f719890e2c4dbbc445049d, which was too naive in assuming that any change to the popup stack while a popup had been pressed into should result in mouse move events to be delivered without buttons. Instead, add a new flag that is set explicitly when the qt_popup_down widget is closed, and remove buttons from the move move events only when that flag is set. Add the sorely missing test case as well, even if we have to accept that not all behavior can be tested reliably. Ie. on macOS, the simulated mouse event differs from the event we do get from the QPA plugin or the system; on Xcb, some of the behavior depends on the window manager. This is something we could try to clean up for Qt 6. Change-Id: Ibf0a0a6fb7d401915057365788947e5a35aa20c3 Fixes: QTBUG-84926 Task-number: QTBUG-82538 Pick-to: 5.15 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io>
* QSslConfiguration::setCiphers - introduce the overload taking QStringTimur Pocheptsov2020-07-011-3/+23
| | | | | | | | | | | | | We had such an overloaded version in QSslSocket, it was deprecated without providing any alternative. Now this function has some use and may be introduced in Qt6, as QSslConfiguration::setCiphers(const QString &). Last but not the least - a useless and strange auto-test was removed (it was creating a list of 5 QSslCiphers each with isNull() == true). That's becasue '!MD5' or 'ALL' (for example) is not a cipher to be found in supportedCiphers. Change-Id: I47eb4c0faa9b52885e883751dd992cd9cb3d26fe Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Sql: Fix heap-user-after-free for globally initialized db objectsAlexandru Croitor2020-07-016-13/+55
| | | | | | | | | | | | | | | Becaues the database objects were created as globals, there was a possible use-after-free issue when deleting the objects on application exit. Move the initialization of the database objects into static variables inside the test constructor. As a drive-by, also add one missing test to the CMake projects. Fixes: QTBUG-85357 Change-Id: I2c8f2c5daee96bb9d1d21dae37950a2da5ffdf27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Let QScreen::grabWindow's winId parameter default to 0 and add testVolker Hilsheimer2020-07-011-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | The platform plugins are implemented to grab the entire screen if no window ID is provided. They do not grab the entire virtual screen, just the screen the method is called on. On macOS, the implementation ignored the window parameter, and always grabbed the entire virtual screen. This change fixes the cocoa implementation. The test passes in local tests (with two displays with different dpr). Since grabbing a screen returns an image with managed colors, we need to convert it to sRGB color spec first, otherwise displaying a grabbed image will produce different results. This will need to be changed once Qt supports a fully color managed flow. The test does not cover the case where a window spans multiple displays, since this is generally not supported at least on macOS. The code that exists in QCocoaScreen to handle that case is untested, but with the exception of the optimization it is also unchanged. Done-with: Morten Sørvig <morten.sorvig@qt.io> Change-Id: I8ac1233e56d559230ff9e10111abfb6227431e8c Fixes: QTBUG-84876 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVector in corelib docsJarek Kobus2020-06-291-1/+1
| | | | | | | Task-number: QTBUG-84469 Task-number: QTBUG-85221 Change-Id: Ieb0ba7d82409e3c053a5788a01e92ea495505643 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Move QAlertLevel and QAlertType enums into the namespace QSslTimur Pocheptsov2020-06-291-4/+2
| | | | | | | | | | Not to pollute the global namespace with rather generic names (especially in case QT_NAMESPACE is none); also drop the (now)redundant 'Q' prefix in the names. Change-Id: I57ea7e3996cced705f7ddbdbc1e0231191b31c43 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix QUrl::toDisplayString(PreferLocalFile) returning an encoded pathDavid Faure2020-06-291-0/+28
| | | | | | | | | | | | | It's supposed to return the same as toLocalFile(), for local files, which means passing QUrl::FullyDecoded just like QUrl::toLocalFile() does. But a few code paths were testing component formatting options without masking other FormattingOptions like RemovePassword, so this had to be fixed. Fixes: QTBUG-84594 Change-Id: I82f15148b6d93516200f9ad6258d474e7f10924a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileDialog: remove deprecated mode QFileDialog::DirectoryOnlyChristian Ehrlicher2020-06-263-13/+2
| | | | | Change-Id: Ia06e80c1bbed3e5bb80793aebd0a4780eb81a36b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Fix tst_qmake not to hang and re-enable itAlexandru Croitor2020-06-261-5/+1
| | | | | | | | | | | | | We don't really know why, but using the ctest --force-new-ctest-process flag stops the test from hanging. Also re-enable the test. Task-number: QTBUG-78449 Task-number: QTBUG-81365 Change-Id: I33094696dfe3f610dc257089074b1c2a9926f651 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove superfluous define from tst_qmakeJoerg Bornemann2020-06-263-23/+0
| | | | | | | The QMAKE_CROSS_COMPILED define isn't used since 2011. Change-Id: I9f03791e9f7c0ef439db5e65d930c0b7cb928974 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix tst_qmake::resources() on WindowsJoerg Bornemann2020-06-264-30/+4
| | | | | | | | | | | | | | | | | | | | | | | | This test calls qmake on a project that generates a .qrc file. On Windows, where debug_and_release is on by default, the generated qrc file ends up in a "debug" or "release" subdirectory. On other platforms the file is generated directly in the build dir. To guess the right location, the preprocessor defines RELEASE_BUILD and DEBUG_BUILD were passed to tst_qmake.cpp by the test's .pro file. While the mapping from debug_and_release was fine for the .pro file, it was commented out in the automatically converted CMakeLists.txt. Instead of trying to fix the condition, we're going the easier route that's used in all other .pro files of tst_qmake: make sure that debug_and_release doesn't get in the way. In other tests this is done by setting DESTDIR = ./ which doesn't work for the generated qrc file. That's why we simply do CONFIG -= debug_and_release to make sure that everything is generated directly in the build dir. Change-Id: I557ac4e21d7b385004d369fae8a3f727d76d4d88 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Skip building tst_qprocess test when cross compilingAlexandru Croitor2020-06-261-1/+6
| | | | | | | | tst_qprocess hangs on the qemu armv7 configuration. Task-number: QTBUG-85287 Change-Id: I5a77a81a24bb1bd315edfcf14f3bcbfd5b925e4d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: Enable specifying just an adapter or phys devLaszlo Agocs2020-06-261-0/+131
| | | | | | | | | Required by OpenXR. A VkPhysicalDevice or an adapter LUID + feature level pair should be adoptable while leaving the rest (device, queue, etc. setup) to QRhi as normal. Change-Id: Iada0972671b037b4efb03e7831b7c9b8c5f2393d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix qsizetype fallout in rhi manual testsLaszlo Agocs2020-06-261-2/+2
| | | | | Change-Id: I574a2930b5eeb4b3e1f3c6fca6d70dbda64ec324 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add explicit encode()/decode() methods to QStringConverterLars Knoll2020-06-261-0/+12
| | | | | | | | | The functional style interface is nice, but does feel alien in some contexts, so better also have explicit encode and decode methods. Change-Id: Ic07ced15f65cdb3a7f1cf044041e341d2ef87f79 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fuzzing: Add fuzz target for QCryptographicHash::resultRobert Loehning2020-06-262-0/+50
| | | | | | | Pick-to: 5.15 Change-Id: Ifc12358dd8cb932fe62c13975554d753a4f1afd9 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in corelibJarek Kobus2020-06-251-1/+1
| | | | | | | | | | Applied to headers only. Source file to be changed separately. Omitted statemachine for now to avoid conflicts. Omitted qmetatype.h for now - to be handled later. Task-number: QTBUG-84469 Change-Id: I317376037a62467c313467d92955ad0b7473aa97 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove QPropertyMemberChangeHandler againSimon Hausmann2020-06-251-20/+0
| | | | | | | | | | | | Adding support for a static notifier within QProperty itself - through a QProperty "sister" class - is more efficient in terms of memory consumption and run-time performance. The MemberChangeHandler permanently takes up at least three pointers, while the notified properties only cost one pointer in the binding. Change-Id: Ia1a8c2b66f1f3c2fe13ae0ad9f12cdb6bdcc35ef Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QNotifiedProperty: Add guard callbackFabian Kosmale2020-06-251-0/+131
| | | | | | | | | | | | | | | A guard callback is a predicate which takes the new value set by setValue or computed as the result of a binding expression. If it returns false, the value is discarded and the old value is kept. Note that due to lazyness, when setting a binding, we still notify everyone as the binding is only evaluated on demand, and the guard can thus only run when someone actually queries the value. Note further that a guard is allowed to modify the value that is passed to it (e.g. to clamp it to a certain range). Task-number: QTBUG-85032 Change-Id: I3551e4357fe5780fb75da80bf8be208ec152dc2a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QNotifiedProperty: pass old value to callback if requestedFabian Kosmale2020-06-251-0/+22
| | | | | | | | | Check at compile time whether the static callback takes an argument (which has to be of the same time as the type of the property). If so, retrieve the old value and pass it to the callback. Change-Id: Ib1c4c9e05b826b6be492b03f66fa72ad015963ee Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use QList instead of QVector in other testsJarek Kobus2020-06-255-34/+25
| | | | | | Task-number: QTBUG-84469 Change-Id: I656c9f73bd2364be39ee67747524e7c4a25c0935 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in sql testsJarek Kobus2020-06-252-15/+11
| | | | | | Task-number: QTBUG-84469 Change-Id: Id429ce85da027541b53d516045a78b739c2e9745 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in testlib testsJarek Kobus2020-06-2511-48/+48
| | | | | | Task-number: QTBUG-84469 Change-Id: I36a69021c8d3491a4fd622f3ecb218e1be8a77bc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in widgets testsJarek Kobus2020-06-2528-287/+270
| | | | | | Task-number: QTBUG-84469 Change-Id: I490fdb237afad2d8a15954fe34d6b549a83fa4aa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in benchmarks testsJarek Kobus2020-06-2513-77/+68
| | | | | | Task-number: QTBUG-84469 Change-Id: Id61d6036067da0bcd0811b1b97df5f1334007b7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in gui testsJarek Kobus2020-06-2528-260/+267
| | | | | | Task-number: QTBUG-84469 Change-Id: Ia86f39597de418dde6cd9ae3170ef919bd27416a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QByteArray's methods taking QString and their usesSona Kurazyan2020-06-2513-28/+11
| | | | | | | | | | [ChangeLog][QtCore][QByteArray] Remove method overloads taking QString as argument, all of which were equivalent to passing the toUtf8() of the string instead. Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in network testsJarek Kobus2020-06-256-8/+8
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic96dc8d29b5d720810ca636284f5fd37e4307acd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QList instead of QVector in dbus testsJarek Kobus2020-06-253-6/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: I37d169770f188837118b4e33aa3a3894bf7aed2c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow qMin, qMax and qBound for types that can be losslessly convertedLars Knoll2020-06-255-0/+31
| | | | | | | | | | | | | | | | Add overloads for qMin and friends where the arguments are of different type, but one can be easily promoted to the other. Return the promoted type. Promotions are only allowed if both types are either signed, unsigned or floating point numbers. This should simplify writing code in many case (as for example qMin(myint64, 1)) and also help reduce source incompatibilities between Qt 5 and Qt 6, where the return types for sizes of our containers changes from int to qsizetype. Change-Id: Ia6bcf16bef0469ea568063e7c32f532da610d1cd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Skip proxy widgets that can't take focus when (back)tabbingVolker Hilsheimer2020-06-251-0/+46
| | | | | | | | | | | | | | Fixes regression introduced in b4981f9d4ca914c6ecaa49bfdd69e51806a3671a, due to which it was possible to back-tab into a widget even though it or its focusProxy had a NoFocus policy. As a drive-by, split the complicated if-statement up a bit for improved readability. Change-Id: Ib0ac2604076e812e340b11534c23ae8ae958d082 Fixes: QTBUG-76924 Pick-to: 5.15 5.12 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't pollute global namespace with #define PVolker Hilsheimer2020-06-251-4/+13
| | | | | | | | | | | Breaks the build if any global header has using P = SomeType; statement, and unnecessary to do so before the headers are included. Change-Id: I3b8cc705bf662f768b8895e4b3ec1428ab39ef27 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix conversion of QVariant() in QJsonArrays and Objects (through CBOR)Thiago Macieira2020-06-242-3/+46
| | | | | | | | | | | | | | | | | | | | | When I wrote the QCborValue to QJsonValue conversion, I used QJsonValue::Undefined because it allowed to keep some level of compatibility in CBOR, despite the function documentation saying that CBOR undefineds became JSON nulls. Which they did. But when we converted QJson{Array,Object} to be backed by CBOR classes, that Undefined meant the insertion into the array/object actually deleted the entry. [ChangeLog][JSON] Fixed a regression from 5.14 that caused values of default-constructed QVariants in QVariantLists, QVariantMaps and QVariantHashes to disappear when converting to JSON via fromVariant{,List,Map,Hash}. Fixes: QTBUG-84610 Pick-to: 5.15 Change-Id: Ic0987177fe463f352db9bd84993f116e2bdacc75 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPair: add a check that SB works as expectedMarc Mutz2020-06-241-0/+51
| | | | | | | | | | We have no doubt it does, because it's compiler-synthesized, but we might want to implement the tuple protocol for QPair in the future and then this will act as a safety net, emulating what users are currently already doing with QPair. Change-Id: Ie37f0214bb1aa64210d25be8a256606f4572febe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use ranged for loops in place of foreach in QTimeZone testsEdward Welbourne2020-06-238-13/+15
| | | | | | | | | This (and use of Q_SLOTS for the test slots) makes it possible to enable QT_NO_KEYWORDS and QT_NO_FOREACH in all the corelib/time/ tests. Change-Id: I85fd358f3d1a72c9269d5260d0224640c1751f2d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use QList instead of QVector in uic testsJarek Kobus2020-06-231-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: I2d3a8e7eb7094844544e841145fa5d2de8c66adb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QString: add char8_t overload of fromUtf8()Marc Mutz2020-06-232-1/+8
| | | | | | | | | | | | | Use the overload-with-template trick from P1423 to avoid ambiguities when existing callers pass 0 or nullptr. Add a qdoc-ignored macro to hide the fact that the overload is a template. [ChangeLog][QtCore][QString] Added char8_t overload of fromUtf8(). Change-Id: Iaa2d365bfa161ef36cc73fa3bad50aabf34d01db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborMap: remove the optimization not to detach from non-const find()Thiago Macieira2020-06-231-0/+62
| | | | | | | | | | | | | | | | | All our tests were find() == end() or !=, which depends on the evaluation order of the arguments to operator==(). If end() is called first, then the detach happens before find() and all is well. But if find() is called first, it may return end() before end() detaches. [ChangeLog][QCborMap] Fixed a bug that could cause the iterator returned from a failing key search with find() not to match end(). Now, every call to find() will detach in shared QCborMaps; to avoid this, use constFind() and constEnd(). Fixes: QTBUG-84583 Pick-to: 5.15 5.12 Change-Id: I552d244076a447ab92d7fffd161793496a8d03a8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QVarLengthArray: add missing move special member functionsMarc Mutz2020-06-221-15/+77
| | | | | | | | | | | | | | | | A QVLA is copyable, so it should be movable, too. Added a helper function a la P1144's uninitialized_relocate_n to deal with the QTypeInfoQuery stuff. This way, the code is re-usable everywhere it's needed. The same cannot be said for QArrayDataOps, which only a parent can love... [ChangeLog][QtCore][QVarLengthArray] Added missing move constructor and move-assignment operator. Task-number: QTBUG-39111 Change-Id: If0dc2aa78eb29062d73dcd3dc4647ba345ae39e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>