summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Update tst_qcborstreamwriter to use QMetaTypeDavid Skoland2020-10-301-10/+10
| | | | | | | Since the QVariant types are deprecated in Qt6, use QMetaType instead Change-Id: I7bddea15a3f1a534d3c6f6b9e7ddf9585a8423bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Adapt QDate::fromString() to accept negative year numbersAndreas Buhr2020-10-303-1/+104
| | | | | | | | | | | | | The documentation states that QDate::fromString() accepts negative year numbers, but it did not. This patch adds support for negative year numbers to QDate::fromString() and corresponding unit tests. Furthermore, tests are added for positive signs (+) in date strings. Fixes: QTBUG-84334 Task-number: QTBUG-84349 Change-Id: I575291e7b8317055d4bb530011d7b10c9cd37ae1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Forbid implicit conversions between QFuture and other typesSona Kurazyan2020-10-303-22/+16
| | | | | | | | | | | | | | | | | | | | | - Remove the casting operator of QFuture<T> to T. It calls QFuture::result(), which may lead to undefined behavior if the user has moved the results from QFuture via QFuture::takeResult() before trying to do the conversion. - Disable implicit conversion of QFuture<T> to QFuture<void>, by making the constructor explicit. If the users really intend to do the conversion, they should do it explicitly. [ChangeLog][Source-Incompatible Changes][QFuture] Implicit conversions of QFuture<T> to T and to QFuture<void> have been disabled. Use QFuture::result() or QFuture::takeResult() where you need to convert QFuture<T> to T. Use the explicit QFuture<void>(const QFuture<T> &) constructor to convert QFuture<T> to QFuture<void>. Change-Id: I153d4137d36365b1611ac934fb3ac2eb667fdd6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Make QVarLengthArray comparisons hidden friendsAllan Sandfeld Jensen2020-10-301-3/+3
| | | | | | Task-number: QTBUG-87975 Change-Id: Iaebb237b3d5d3e881caf9a93153e295af051e2ab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add unit tests for QDateTimeParser internalsAndreas Buhr2020-10-301-0/+78
| | | | | | | | | | | | | | | | | | | | So far, the internals of QDateTimeParser and especially the handling of 'Intermediate' values were only tested implicitly by tst_qdatetimeedit. 'Intermediate' values are values which are not valid according to the specified format, but could become valid by adding more characters. This patch adds unit tests which tests parsing of these intermediate values directly. These tests will help implement handling of negative year numbers, where additional complications arise because of possible ambiguities between the minus sign '-' and the separator '-'. Task-number: QTBUG-84334 Change-Id: Ia6ba08df198288b8b11d3b2d2052c194f04fe8a1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the comparison operators of QFutureSona Kurazyan2020-10-292-4/+1
| | | | | | | | | | | | | | These operators don't do what the user might expect and may lead to confusing results. [ChangeLog][Source-Incompatible Changes][QFuture] The comparison operators of QFuture have been removed. They were comparing the underlying d-ptrs instead of comparing the results (as the users might expect), which is not very helpful for the users point of view. Change-Id: I80a887610eac38b60329128cca52cdb5fb515207 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Purge deprecated language and country codes from QLocaleEdward Welbourne2020-10-291-28/+0
| | | | | | | | | | | | | | | | | | | | Requires subsequent re-numbering of the enum tables to eliminate gaps, before locale data can be regenerated. However, it will work with the present locale data, since it merely loses the means to use some names for which the available data was just the name and code. This implies a transient issue of recognising some codes for which there is no actual enum member; but relevant code will work as before, finding nothing but the code and its name. This shall be resolved by a coming BiC change to resort the language, country and script codes, changing the numbering (almost) completely. [ChangeLog][QtCore][QLocale] Various obsolete language and country codes have been removed. Some lacked locale data, others were obsolete aliases. All have been deprecated in 5.15. Task-number: QTBUG-84669 Change-Id: I45fc76a5f2f6c3b0ea3c1bb61e917da984183783 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Initialize values in collection testsDavid Skoland2020-10-281-2/+2
| | | | | | | This silences a compiler warning Change-Id: I8d01b5d008ab4f90d5551fef522e2e3c3adb02ba Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QItemSelectionRange's operator<()Edward Welbourne2020-10-281-141/+0
| | | | | | | | | | | | As advocated in a ### Qt 6 comment. [ChangeLog][QtCore][QItemSelectionRange] QItemSelectionRange no longer supports ordering. The prior ordering was inconsistent with equality and should not be needed. Task-number: QTBUG-85700 Change-Id: I5eb372c203cae19db40fa67f706d911785652d5f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate ordering on QItemSelectionRangeEdward Welbourne2020-10-281-0/+4
| | | | | | | | | | | | | | | Ready for removal at Qt 6, as advocated in a ### comment. It was never done consistently with operator==(), apparently, and should not be needed in any case. [ChangeLog][QtCore][QItemSelectionRange] Ordering of QItemSelectionRange is now deprecated. It was not consistent with equality and should not be needed. Task-number: QTBUG-85700 Pick-to: 5.15 5.15.2 Change-Id: Ie99294bd7fc18f2a497598ae08840886b0a6d62d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QByteArray: make (ap|pre)pend(const QByteArray &) consider reservedMårten Nordheim2020-10-281-0/+12
| | | | | | | | | | Append was previously optimized for lhs being empty but it should've also taken into account if space had been reserved. Apply the same optimization to prepend while we're at it. Change-Id: I5e5d33a3189b9ad88d45e858a2ac412cbc294f79 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate old aliases for two countries and several languagesEdward Welbourne2020-10-282-9/+9
| | | | | | | | | | [ChangeLog][QtCore][QLocale] Deprecated several Language and Country aliases, ready for removal in Qt 6.0, in favor of their newer names. Task-number: QTBUG-84669 Pick-to: 5.15 5.15.2 Change-Id: Iebaa0a5a77bfa12f7014de53fab4a25b5f1cc92c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate QLocale::Language entries that no locale data relates toEdward Welbourne2020-10-281-10/+12
| | | | | | | | | | | | | | | | | These are languages for which CLDR does not even recognize the claimed language code (three-letter codes except for bh = Bihari, which might be an old name for bho = Bhojpuri, which CLDR does give, but provides no locale data using it). [ChangeLog][QtCore][QLocale::Language] Many obsolete language names are now deprecated in preparation for removal at Qt 6.0. No data has been available for any locale using these languages since CLDR v29 (at least; Qt now uses v37). Task-number: QTBUG-84669 Pick-to: 5.15 5.15.2 Change-Id: I2bf2d49211ade7cc511277f35fb1a247e7048b31 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "QObject: simplify part of connection logic"Fabian Kosmale2020-10-271-0/+20
| | | | | | | | | | | | | | | This reverts commit 1918c689d78b0f6a718343e7ebceb387acc32a97. The template gets always instantiated in QObjectPrivate::connect, even if the connection types is not Qt::(Blocking)QueuedConnection. For non-queued connections we however support using incomplete types in connect. The only way to fix this would be to make the connection type a template parameter of QObjectPrivate::connect (or at lesat pass some compile time constant indicating "blocking"-ness) along, so that we can use if constexpr instead of if. As all involved classes are private, we can postpone investigating this solution to 6.1 Change-Id: Ieffaf015f8e60ca6ac6f85eb9e2756e480060b4f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix tst_QDeadlineTimer::stdchrono() flaky testJarek Kobus2020-10-272-53/+34
| | | | | | | | | | | | | | | | This patch reverts the last attempt to fix it: 4a1de178c9cc891560f38d64d89074799b0fa0e1. In addition, instead of using imprecise QTest::qSleep() we trigger a single shot PreciseTimer twice and gather the measurements in lambdas. We wait for lambdas to be executed - we give it twice as much time as is in theory needed. Afterwards we verify all the data collected in lambdas. Fixes: QTBUG-82825 Change-Id: Ib691f5f23a92fb8b41a24f7b603981d9c9450ddc Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add unit tests for qdatetimeparserAndreas Buhr2020-10-236-0/+89
| | | | | | | | | | | | | The qdatetimeparser was not tested explicitly so far, but only implicitly in tst_qdate / tst_qdatetime / tst_qdatetimeedit etc. This made it difficult to test some corner cases, especially in the context of unfinished dates, i.e. dates which are invalid, but could become valid by adding more characters. This is used to validate user input in qdatetimeedit. Task-number: QTBUG-84334 Change-Id: I27202849abb1b7cad96d3e25f7ac81ce85272b2a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove usage of deprecated QStandardPaths::DataLocationKarsten Heimrich2020-10-231-2/+2
| | | | | | | | | * Rearrange the documention to match the enumeration order. Fixes: QTBUG-87037 Change-Id: Iad001351e0f309e694b8bbd503813017e6586a21 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-237-35/+43
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Do not store non relocatable types in QVariants internal storageLars Knoll2020-10-231-1/+26
| | | | | | | | | | | This mostly reverts change 76e8e8e9c8093f093cb9f37d61d273f43398fefb. The reason is that storing non relocatable types inline in QVariants storage would implicitly make QVariant non relocatable. Fixes: QTBUG-87686 Change-Id: I2a09b1dcdd907d60085dccf17f987086dcba878c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename the QMetaType::MovableType flag to RelocatableTypeLars Knoll2020-10-231-2/+2
| | | | | | | Keep this in sync with the changes we have done in QTypeInfo. Change-Id: Iaacb0f3cc5c46d3486084a1f6eca480a233d5e1a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add unit test for malformed RFC2822 datesAndreas Buhr2020-10-221-1/+11
| | | | | | | | | | | RFC2822 requires times to be in the format 'HH:mm' or 'HH:mm:ss'. We did not have unit tests to check that malformed RFC2822 dates are rejected. This patch adds such unit tests for truncated hours/minutes/seconds. Change-Id: Id5b9390112e633e617722439ad59439e6aeba841 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix strange capacity check in tst_QString::append_special_casesAndrei Golubev2020-10-211-1/+2
| | | | | | | | | | | We cannot rely on "QString a; a.insert(0, u'A');" to give a.capacity() >= 3, this is clearly an implementation detail. Changed the check to a meaningful one Task-number: QTBUG-87416 Change-Id: I2e017c1292d360e32b85b903361027485c08ea74 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRandomGenerator: add 64-bit bounded() versionsThiago Macieira2020-10-201-6/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the 32-bit version, we can't go to a bigger integer type to do the multiplication with. So instead accept looping. Both libstdc++ and libc++ implement std::uniform_int_distribution this way anyway, but in a far more complex way. There is no looping if the "highest" is a power of two. The worst-case scenario is when "highest" is one past a power of two (like 65). In that case, we'll loop until the number is in range. Since all bits have equal probability of being zero or one, there's a 50-50 chance that the most significant useful bit will be set[*], in which case we'll need to loop and we again get the same probability. So on average, we only need two iterations to get an acceptable result. [*] There's also a possibility that the other bits are such that the number is still in range. For 65, we'd need the other 5 bits to be zero (64 is a valid result), but the probability of that is only 1/2^5 = 3.125%. The bigger "highest" is, the closer we get to zero, so approximate by saying that never happens and instead calculate that the most significant useful bit is the controlling one. [ChangeLog][QtCore][QRandomGenerator] Added 64-bit versions of the bounded() functions. They are useful in conjunction with Qt 6's 64-bit container sizes, so code that used to call bounded(list.size()) in Qt 5 will continue to compile and work in Qt 6. Fixes: QTBUG-86318 Change-Id: I3eb349b832c14610895efffd16356927fe78fd02 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Auto tests: Fix some MSVC warnings about integer conversionsFriedemann Kleint2020-10-211-1/+1
| | | | | Change-Id: Ibab8028ccdb9a4b02cadc6d2e85e8a0472f0d96f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use qmetaobject_p.h's MetaObjectFlag in QMetaObjectBuilderEdward Welbourne2020-10-202-3/+3
| | | | | | | | This saves duplicating them with its own flags. Task-number: QTBUG-85700 Change-Id: I9e938322fd787282cfd9f941f83af8c0d76aaa9d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Drop constexpr from QAtomicTraits::isLockFree()Edward Welbourne2020-10-202-8/+10
| | | | | | | | | As requested by a ### Qt 6 comment. This then implied a few other functions weren't constexpr, which broke some tests. Task-number: QTBUG-85700 Change-Id: I6522a9b2d7a74e117442121400a1d7198d323967 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAssociativeIterable: Unwrap variants on value()Ulf Hermann2020-10-191-0/+14
| | | | | | Fixes: QTBUG-87688 Change-Id: I66515eaa1217c34f003648af6423b318b54977c4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QAssociativeIterable: Add methods to add/remove keys and valuesUlf Hermann2020-10-191-0/+10
| | | | | | | | This way we can actually modify the container. Previously the interface was rather useless. Change-Id: I278aae46999862ada115c9066a010d7de5cde4ff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaContainer: Consistently coerce typesUlf Hermann2020-10-191-43/+84
| | | | | | | | | | | | | | | The high-level iterable interfaces should coerce the types of most QVariants passed to the expected ones. To do this, move the type coercion code into qvariant.{h|cpp} so that it is available to the QVariantRef specializations. The exception are variants passed to the find() functions of associative iterables. Here, we should not coerce values we cannot convert to the default-constructed keys. Instead we return end() in such cases. Fixes: QTBUG-87687 Change-Id: I0bd4e5c4e4e270dd3bf36cb3fb115794828077f2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Tidy up tst_QLocale::ctor(), reduce needless repetitionEdward Welbourne2020-10-191-21/+21
| | | | | | | | | | | | The test macro's first three parameters were given a QLocale:: prefix by the macro, but the last three weren't. Save uses of the macro the need to repeat the prefix in all parameters, thereby making the test cases easier to read. Also, we can compare enum values, rather than casting them to int; and, when a test fails, reporting the enum name is far more informative than reporting the integer that represents it. Change-Id: Ib0360c51049333b4a00ea84e271c99db6724334f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix blatant typo in QTimeZone testEdward Welbourne2020-10-191-8/+6
| | | | | | | | | | | This revealed that the test was always broken; it had simply never actually been checked. Done-with: Andreas Buhr <andreas.buhr@qt.io> Change-Id: I85ac7ba30738fa3b41bf8440a059ee3fabb4726b Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Check time-text is long enough while checking for its colonsEdward Welbourne2020-10-193-1/+7
| | | | | | | | | | Added some tests that trigger an assert without this check. (Drive-by: renamed one QTime test to match its QDate(Time)? counterparts.) Change-Id: I3d6767605fdcca13a9b4d43a32904f584eb57cf9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Remove vacuous tst_QLocale::cleanupTestCase()Edward Welbourne2020-10-191-4/+0
| | | | | | Change-Id: I8bf9915045dce434f19de9c3745e1be28a833e8f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QProperty: Add value() and setValue() to QBindableUlf Hermann2020-10-191-0/+3
| | | | | | | | This simplifies code that would otherwise need to use the setter and getter in addition to the bindable. Change-Id: Iec6510b4f578f5b223c63b3a0719257a0cf2463d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add function to access QLockFile's file nameShantanu Tushar2020-10-181-0/+1
| | | | | | | | This is useful in cases like error handling when you need to print the name of the lock file. Change-Id: Ife4901ed53ae81d19e68cce7f1c173ef3745d56f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_containerapisymmetry: code tidiesGiuseppe D'Angelo2020-10-181-174/+18
| | | | | | | | We now require C++17 and thus C++11 features or standard headers should no longer be conditional. Change-Id: I6b72306e809f71ec77acf7ffb97e2ed2ccd96e9d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Split QMutex and QRecursiveMutexLars Knoll2020-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | These classes should not inherit from each other anymore in Qt 6. The reason is that this makes the 95% case of using a non-recursive mutex much slower than it has to be. This way, QMutex can now inline the fast path and be pretty much as fast as QBasicMutex is in Qt 5. They actually use the same code paths now. The main difference is that QMutex allows calling tryLock() with a timeout, which that is not allowed for QBasicMutex. [ChangeLog][QtCore][QMutex] QMutex does not support recursive locking anymore. Use QRecursiveMutex for that purpose. QRecursiveMutex does not inherit QMutex anymore in Qt 6. Change-Id: I10f9bab6269a9181a2e9f534fb72ce65bc76d989 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some compiler warnings from testsVolker Hilsheimer2020-10-162-3/+3
| | | | | | | | For iterators that return a value, don't use reference in ranged for, and cast numeric literal to correct size type for QCOMPARE. Change-Id: Idfd09dbc2ef3ab1bf025c7859ea6e2e9572bc9a1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix warning in test: unused capture in lambdaVolker Hilsheimer2020-10-161-1/+1
| | | | | | | Change-Id: Ifa9bab843feb670f8400c26fd78f96db55bfd79e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* Rename QPromise starting and finishing methods to start and finishAndrei Golubev2020-10-162-36/+36
| | | | | | | | | Proposed during API review Change-Id: I9c43e1915c50803ab69bfe07a91c05d2224b86c4 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Make QPromise::addResult() return boolean status of operationAndrei Golubev2020-10-162-51/+51
| | | | | | | | | | | | | | | Changed QPromise::addResult() to return bool value. True is returned when result is added and false is returned when e.g. promise is in final state (canceled or finished) or when addResult() is called twice with the same index as argument (in which case new value is rejected) Updated QFutureInterface::reportFinished() that accepts optional result as argument to align with other result adding methods. This function is "internal" only (as of now), so no documentation update is needed Change-Id: I2d63069246e5e5c8cf04529c22bb296faaaae53d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix warning: helper functions are only used on some platformsVolker Hilsheimer2020-10-161-2/+2
| | | | | | | | Tag them as [[maybe_unused]] to silence compiler on platforms where they are not used. Change-Id: I12243c0409c66863617f073f968e50f913c58a67 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix compile time type normalization codeLars Knoll2020-10-142-4/+42
| | | | | | | | | | | | | | | | | | | | | Use a simpler constexpr to generate type name on gcc This works around an ICE on gcc in release mode when compiling with PCH enabled. As the type we're getting from Q_FUNC_INFO is already in a somewhat normalized form, this requires significanlty less processing and esp. not a recursive constexpr method which I suspect triggers the ICE. Fix integer type conversions to also properly normalize long long values (to q(u)longlong. Make sure the mapping also works on MSVC, where long long types get mapped to __int64. Also, normalize unsigned short and unsigned char to ushort and uchar, respectively, to follow the convention set by uint and ulong. Add some test cases to verify the mappings. Change-Id: I3dec5764450bf22ab6f066597803c3f46c2cd5ac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Reject overwrites by the same index in QPromise::addResult()Andrei Golubev2020-10-132-6/+195
| | | | | | | | | | | | One can call addResult(value, index) twice and consequently set the value twice by the same index. This seems rather strange and probably should not be allowed. This commit rejects setting results when there's already a valid result by that index. Consequently, this fixes memory leaks caused by N-times-called addResult(..., index) Fixes: QTBUG-86828 Change-Id: I77494f2cb73ce727ffad721cfcdcaa420899eb25 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove timeStep parameter from QAnimationDrive::advanceAnimationVolker Hilsheimer2020-10-131-2/+2
| | | | | | | | | | | | This reverts commit 7544c242cb935b5ff625e54c3facceea535c6ae5, which reverted the first removal of the parameter under the assumption that it caused flakiness in tests. The flakiness was instead caused by changes to the wait functions in QTest, so remove the parameter again. Change-Id: I98154d5d7268375aebbcb09de757e75d9b765c5f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qDebug: Avoid implicit QVariant conversionFabian Kosmale2020-10-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | This commit restricts operator<<(QDebug lhs, QVariant rhs) to only work if rhs is actually of type QVariant (instead of any type convertible to QVariant). This is especially important as a) we check in QMetaType whether (slightly simplified) QDebug{} << std::declval<T>() is valid, and if so, register a function which simply uses the operator. b) In QVariant, we ask the metatype system for the contained types registered debug function and then use it. If a type now does not have its own operator<< for QDebug, but is implicitly convertible to QVariant containing itself, this would lead to an infinite recursion, when trying to use qDebug with that type. The registered function in a) would just convert the type to QVariant, and then ask the QVariant to print itself. Disallowing implicit conversions in qDebug in general was considered (i.e. adding template<typename T> operator<<(T) = delete in QDebug ), but discarded as it breaks too much code relying on conversions. Fixes: QTBUG-87122 Change-Id: Ib709297670cbc6cc307efd0dfd8e5b0279df9414 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Temporarily disable QFuture::takeResult() methodSona Kurazyan2020-10-121-0/+8
| | | | | | | | | | | | QFuture::takeResult() currently returns std::vector instead of QList, because QList does not support move-only types. Disable this method until QList is fixed to work with move-only types in Qt 6.1. Also did minor doc-fixes. Change-Id: I87feaf75d9433a3b540edd00039c3e21d6994985 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Handle notifier list modification during iterationFabian Kosmale2020-10-121-0/+53
| | | | | | | | | | | | | | As propertyobservers can execute arbitrarily complex code, they can also modify the obsever list in multiple ways. To protect against list corruption resulting from this, we introduce a protection scheme which makes the list resilient against modification. A detailed description of the scheme can be found as a comment in QPropertyObserverPointer::notify. Task-number: QTBUG-87153 Change-Id: I9bb49e457165ddc1e4c8bbdf3d3c9fbf5ff27e94 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve QRectF::toRect()Allan Sandfeld Jensen2020-10-121-6/+6
| | | | | | | | | Implement the better rounding mechanism that was previously blocked by requiring C++14 to be constexpr. Change-Id: I4e5b179ce0703f5c0b41c3f0ea00d28dfe53740c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clear pending results in ResultStoreAndrei Golubev2020-10-091-0/+75
| | | | | | | | Pending results were never cleared by result store. This led to memory leaks when the results never transitioned to "visible" results Change-Id: I674302eb51542ad5f4d918da68d616428c73ae9f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>