summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tst_qglobalstatic is halted on INTEGRITY deviceTatiana Borisova2021-12-201-0/+6
| | | | | | | | | | | | - Stress test creates too many threads on run time. Testing system is limited in 123. Task-number: QTBUG-99123 Change-Id: I215074fa432c8aa18b2a753169646841c01d0b2a Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 43e9f86cc15fe5b394ee1690b302104118572fe1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtConcurrent::run crashes on program exitTianlu Shao2021-12-201-0/+12
| | | | | | | | | | | | | When an application is about to be closed and all the destructors are called, if there isQtConcurrent::run on the way, it crashes as the internal threadpool pointer is nullptr. Fixes: QTBUG-98901 Change-Id: Idd84d1518fc6a225263e6666a0f1de2ccef79c82 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 87b93c29be02f0a7ff9424b5e2b6431e20bd4c40) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QXmlStreamReader: update test distributionIvan Solovev2021-12-19653-3918/+27
| | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the linked bugreport, we are not allowed to distribute the uncompressed files from one of the XML test datasets that we use in our tests. This patch removes the uncompressed version, and replaces it by the xmltest.zip archive taken from [0]. Once the test is started, QZipReader is used to uncompress the archive, and once the test is done, the uncompressed data is removed. However the test data from [0] is very old, so it is slightly different from what we had previously (the previous data was taken from w3c). As a result, 4 test cases are failing with this data. To fix it, we store the updated versions of 4 xml files separately, and replace them after uncompressing the archive. [0]: http://www.jclark.com/xml/ Fixes: QTBUG-81503 Change-Id: Ied5233970a529deebca56b1eab07fe1c328a2ee0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit f8b74a49576ea453b3bfc7356a23cd4f2171fa76) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QPropertyAnimation: fix leaks occurring under normal operationMarc Mutz2021-12-181-11/+10
| | | | | | | | | | | | | Tests were leaking objects even if all tests passed. In two cases, there just wasn't a delete at all, in a third, the existing delete wasn't reached because of a QSKIP. tst_QPropertyAnimation is now, locally, LSan-clean. Change-Id: Ia53d6f6e467f1d2598a7c50efcdf3a3732fe54df Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dc672cf35ab693a5505f704d93d4cf4ea2c848c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVariant: use a typedef name when saving user types to QDataStreamThiago Macieira2021-12-174-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the way Qt 5 and 6 registered type names, they end up producing different type names for the same content for a typedef. For example, because Q_DECLARE_METATYPE can't manage a comma (it's a macro), users are forced to write something like: using MyTypeMap = QMap<QString, MyType> Q_DECLARE_METATYPE(MyTypeMap) Qt 5's Q_DECLARE_METATYPE's argument "MyTypeMap" was the only name we knew about the type, so that's what got saved in the stream. However, Qt 6 QtPrivate::typenameHelper is much more clever and obtains the name from the compiler itself, so it "sees through" the typedef and registers "QMap<QString,MyType>" as the official type name. If another library/plugin has a different typedef name for the same type (e.g., StringTypeMap), it's indeterminate which type gets saved and will even change from run to run (depends on the QHash order). [ChangeLog][QtCore][QDataStream] If QDataStream is used with a QDataStream::Version < Qt_6_0 to serialize a user type that was registered via a typedef with the metatype system, the typedef's name is used in the stream instead of the non-typedef name. This restores compatibility with Qt 5, allowing existing content to read the same QDataStreams; reading from older Qt 6 versions should not be affected. (Note: if more than one typedef name is registered, it's indetermine which name gets used) Fixes: QTBUG-96916 Change-Id: I2bbf422288924c198645fffd16a8d811aa58201e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 46dc8e453ae1d0c1eb749cfebe686995f3a6cfd0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QPropertyAnimation: fix wrong commentMarc Mutz2021-12-171-1/+5
| | | | | | | | | | | ... and add some additional checks that hopefully leave the next reader of the code a little less confused than this one was. Change-Id: I73c1b9b1ed1683e3b2de0d811d9b20d65464dff4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 2fef4636aaf00832effdff6045005df0cfb71937) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QIODevice: fix UB (precondition violation) in ↵Marc Mutz2021-12-171-3/+6
| | | | | | | | | | | | | | | | | | | SequentialReadBuffer::readData() memcpy() mustn't be called with a nullptr, even if the size is zero. Fixes ubsan error: tst_qiodevice.cpp:561:15: runtime error: null pointer passed as argument 1, which is declared to never be null Even though ubsan only complained about one of them, fix all three occurrences of the pattern in the test. Change-Id: I5c06ab4a20a9e9f8831392c46c6969c05248fdac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 572b55baa42787447643169811784bc64024fb5e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QByteArray: fix UB (signed overflow)Marc Mutz2021-12-171-2/+3
| | | | | | | | | | | | | | | | The first case is simple, as it's a static overflow. Theoretically, the compiler would be allowed to just remove the complete function as dead code. This is an error left from the port from int to qsizetype: Qt 5.15 there has uint(MaxAllocSize) + 1, so use quint here again, qint64 is wrong. In the second case, we _may_ reach alloc == MaxAllocSize. Check that, if we do, we don't then add 1 to it. Change-Id: I93044ed6f1b77559642fa1e4e8f313cf59eeeb79 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b1938e5787425c39d6e9f6a41605338d1822c86b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix hash lookup using the value of a key iteratorLars Knoll2021-12-161-0/+17
| | | | | | | | | | | | | | | | QHash::operator[] could grow the hash even if the key being looked up already existed. This in turn invalidated all iterators. Avoid this by refactoring findOrInsert() to not grow if the key already exists. Added advantage is that this should make lookups of existing keys slightly faster. Fixes: QTBUG-97752 Change-Id: I9df30459797b42c434ba0ee299fd1d55af8d2313 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit d1626ca6b0671efdb95041fa5ce09be449b253a0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix qt_scrollRectInImage when scrolling outside of the imageTor Arne Vestbø2021-12-141-0/+39
| | | | | | | | | | | | | | | | | | | | | | We were clipping the source rect to the image, both pre and post scrolling, but did not apply the same logic to the target position. By computing the target position based on the already clipped source rect we ensure that the target position is also correct. This was causing valgrind warnings on Linux, and crashes on Windows, when trying to test the lower level QBackingStore::scroll() function. The reason we were not seeing this in practice was that QWidget does its own sanitation and clipping of the arguments before passing them on. As a drive-by, fix the access of image to use constBits instead of a manual cast, and rename variables to better reflect their use. Change-Id: Ibc190c2ef825e634956758f612a018f642f4202b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit ae6dc7d6df12b3a5631d20b968823e23f6d7f1f2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Bump version to 6.2.3Jani Heikkinen2021-12-142-2/+2
| | | | | Change-Id: Ieacae37b05e33210f60c0f5f58a1ae5513f401fb Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* QNX: inotify is supported, so enable testsPasi Petäjäjärvi2021-12-121-3/+3
| | | | | | | | | | Also change usage of QDir::currentPath to QDir::tempPath instead as QNX tests are run on CI at qemu over NFS. Change-Id: I2e1d6629299acd125117bcce90320c70eeb4a1a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6fbb02add54d4903c9f4092e978ec58a844dcd89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Successful check depends on user running testPasi Petäjäjärvi2021-12-121-1/+1
| | | | | | | | | Modify similar like is used for Windows Change-Id: I133a8dde2e78cc66aa9544246cd750a6543b4883 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ac8ce185222ba3bad6bc3e3b28f24b6fc14bbe78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Limit maximum largefile sizePasi Petäjäjärvi2021-12-121-1/+6
| | | | | | | Change-Id: I4e43eaea98e893453c8c1356da63edb0c059f896 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d500fc55808d325b966ac534873517f145ebf662) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Skip failing testPasi Petäjäjärvi2021-12-121-0/+3
| | | | | | | | | | Seems to be bug in QNX itself Task-number: QTBUG-98561 Change-Id: I525bd269b674e9e2b8c994bf778ab14b727df33f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d214c5a09afa48b4498b40eb5594658c8e257e8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Cannot handle threads in given timePasi Petäjäjärvi2021-12-121-0/+4
| | | | | | | | | Large amount of threads is unstable and do not finish in given time Change-Id: I0ce4c8cd278d6611c9e9da7326048279ccc458fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit fbbcd109f518adaedc5b3a009b204ac78a284a9a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Remove not supported testcasePasi Petäjäjärvi2021-12-121-1/+3
| | | | | | | | | | Still not implemented Task-number: QTBUG-40785 Change-Id: I9bb89ccaff30a3d906bf5665bc6ef981717aa054 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 697cb6eead237fb3916c1f31935babaae14fc79d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Remove expected failPasi Petäjäjärvi2021-12-122-17/+0
| | | | | | | | | Works with QCC 8.3.0 (Based GCC 8.3.0 20190222 (stable)) Change-Id: I130847627a4b77ced83d196a7a1674963c5cd3e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 578f7d56eb4da182956832b0cb06d3ca42e75d34) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtFuture::connect: exclude QPrivateSignal from the resulting future typeSona Kurazyan2021-12-121-1/+46
| | | | | | | | | | | | | Filter out the last argument of type QPrivateSignal from the signal's arguments passed to QtFuture::connect(). Fixes: QTBUG-92501 Change-Id: Idcd6baba1f01fcc94fa64b1c7030a629d01ed7a1 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit ed546ff216010c979b94263aab4773a1a6afd5bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix widget gesture grabbingVolker Hilsheimer2021-12-111-0/+20
| | | | | | | | | | | | | | | | | | | After 7369c31ca1f446e81eda1c93ba13767ffcd83efe, unaccepted touch points were not grabbed anymore in calls to activateImplicitTouchGrab. However, gesture recognition relies that widgets for which a gesture has been partially recognized grab also unaccepted touch points. Add a parameter to allow the implicit grabbing to take place also for unaccepted event points. Add test case that replays touch events similar to what Squish is doing, and fails without this fix. Change-Id: Idb0b20301b1827be57a03013a59043d97c2ee7b6 Reviewed-by: Stefan Gehn <stefan.gehn@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9da1f6b6080b667f7e879f953441b713ccff656b) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QList: fix typo in QList(It, It)Marc Mutz2021-12-111-12/+0
| | | | | | | | | | | | | Remove scaffolding in the test again. [ChangeLog][QtCore][QList] Fixed a regression that caused the range constructor to fail for pure input_iterator's. Fixes: QTBUG-99036 Change-Id: I72d01a9c44c3862c335d96538f26a453b4c7c554 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 48b75def5d734d8f8ecf2805ba64be6c99aca978) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_containerapisymmetry: test ranged ctors with pure input_iterator typesMarc Mutz2021-12-091-0/+52
| | | | | | | | | | | | Fails in Qt 6, succeeds in Qt 5.15, therefore needed to add the version check. Task-number: QTBUG-99036 Change-Id: I9da1b2511d844b5fdcb63fdc58c8bc34d0f65736 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 2e07d045ff617173dbbb1382b67f7afe30564699) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVarLengthArray: fix size update on failed append()Marc Mutz2021-12-091-0/+45
| | | | | | | | | | | | | | | If the in-place constructor throws, the old code had already updated the container's size(). Fix by delaying the update to after the in-place construction. [ChangeLog][QtCore][QVarLengthArray] Fixed a bug whereby a failed append() would leave the container with an inconsistent size(). Change-Id: Ief1e668d945149bd8ba96c8af1398baaa7876880 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit d4a88e4ea4dd0d24c9c43553dd4c48a79635803c) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix the benchmark for QList::removeAll()Sona Kurazyan2021-12-091-89/+26
| | | | | | | | | | | | | | | | | The benchmark was making assumptions about number of constructor/assignment operator calls, which are not valid in Qt 6, after the implementation of QList has changed. Considering that we already check number of constructions, copy constructions, etc., in tst_qlist.cpp, remove the checks from the benchmark. As a driveby, fix the following warning: "warning: parameter 'i' shadows member inherited from type 'MyBase'" Fixes: QTBUG-95096 Change-Id: Ida68fa5803641c8fa84f8309c0093986ed4c0a2b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0fbeac01156c57dc6e48087b7a8dea4644294f6a)
* tests: add a capability check for QWindow::requestActivate() callLiang Qi2021-12-081-0/+3
| | | | | | | | | This amends b65159a5ea8db05165b2eaab8e180a12f30063e4. Change-Id: I6055004375b440997ea41b3e4538854780202e10 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit c8609d1e7a1f00827a7611182212c3d3bc6e03ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Widgets: setTransientParent() when a QMenu is a windowLiang Qi2021-12-081-0/+49
| | | | | | | | | | | | | | On some platforms, such as X11 and Wayland with some compositors, QMenu could be a popup window, which should be set a transient parent to get relative position, which is requested by Wayland. Added transientParentWindow() for QMenuPrivate like QDialogPrivate. Fixes: QTBUG-68636 Change-Id: I6d8880cb008ecf61a4c005898b38e3953379a13d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 493a85a9e468874471057910a61e7c54a45eee83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVarLengthArray: add some basic checks for default-ctorMarc Mutz2021-12-071-0/+21
| | | | | | | | | | There seems to have been no-one that checked a simple empty()/isEmpty()... Change-Id: I7fa567f556532dfa21db759719f1303a768a9732 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit cb00db5a7e644d381ec58f7b715e0312c57f282a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFontDatabase (Windows): Sanitize font requests earlyMårten Nordheim2021-12-071-0/+31
| | | | | | | | | | | | | | | | | | | | After the windows font engine was no longer marking everything as scalable we started limiting the font size of requests to the maximum of Courier when it was requested. This was a regression from 5.8 and not in agreement with our documentation. The problem is that we would only make the switch from Courier to Courier New after having already gone through the foundry-lookup and found a closest-available font size for Courier. With this sanitization step in the backend we can make these changes early enough that we haven't yet adjusted e.g. the font size. Fixes: QTBUG-58995 Change-Id: I319e93e6b78c7c3c5539964ac5ab4e05f8902ab6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 6f542f19bfe7bf3c0729f33d163841fbb6f169e7) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QMultiHash: fix erase returning the wrong iteratorMårten Nordheim2021-12-071-0/+16
| | | | | | | | | | | | | When deleting the last item in a chain, without it being the last item in the chain, then we re-use the iterator which was passed in as an argument. This is wrong if we detached earlier in the function, and means we return an iterator to the previously shared data. Change-Id: I7da6309e23a32073da59e7da0cbfd1d16734f1ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 78df625510b73d7b7709be16f9a168ba8c3f4d19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_qfloat16 runtime failure for INTEGRITYTatiana Borisova2021-12-061-0/+13
| | | | | | | | | | | - GHS compiler is not fully compliant with iec559. Therefore we need to update is_iec559 checking for GHS case. Change-Id: Ia094509d26bf5f0109f2937547a056267019cffb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> (cherry picked from commit eba9196304dcc9129a7bb68db87c6fb42c953090) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove chip.debug compiled binary leftover from debuggingDmitry Shachnev2021-12-061-0/+0
| | | | | | | Change-Id: I9d1ca06ffb5f9b8fc6e6042c399311dcec059521 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f25761c617774e5915e0c2b0dda4459cddf1aecd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTextDocument: fix an off-by-one in the changed signal for listsEirik Aavitsland2021-12-061-0/+60
| | | | | | | | | | | | | | | | | | When blocks are added or removed in block groups, i.e. items added or removed from text lists, the whole group is marked as changed, but the calculation of the before/after group length would be one off. That was reflected in the contentsChange signal. Add unit test. Since the whole group changes when list items are added, text is removed and the change-begin is not where the cursor was when the change was made. Fixes: QTBUG-82455 Change-Id: I99ee2cfef4944fcac8aca492741fd0f3b0de4920 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 8fbedf2196a292fe2affcf83ddc846b9c852772a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't change resolve mask when setting brush doesn't change paletteVolker Hilsheimer2021-12-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 556511f9f39ddc887481e0cd5a877134ceb0da6b, which moved the resolve mask storage into the palette's d-pointer, modifying the resolve mask requires a detach. As of now, we only detached when setting a different brush, but always modified the resolve mask, which broke palettes that shared the d-pointer (likely the global default palette). However, detaching has negative side effects when styles set brushes on temporary palette objects and then use that palette object's cache key to build a cache of pixmaps. As each drawing would detach the palette (even if the palette doesn't change, which is likely), the cache key changes with each detach, and the cache would quickly increase in size. This was addressed in changes d7bcdc3a442b99c2caebd4cfd38de67e14090e05 and 1e75dcf2518e37a7b83d006a4e002f972615b43b. We can either detach and find other ways to address the issues from QTBUG-65475, or we can not change the resolve mask when the brush doesn't change and completely ignore the call. Since QFont ignores the setting of any attribute to a value that is identical to the current value, and since it's possible to force that the resolve-bit is set by calling setBrush twice with different brushes, ignoring the call seems like the better solution. [ChangeLog][QtGui][QPalette] Setting a brush on a palette that is identical to the current brush no longer sets the resolve mask bit for that particular role, so items using the palette will continue to inherit changes from parent items. Fixes: QTBUG-98762 Task-number: QTBUG-65475 Change-Id: Ife0f934b6a066858408ef75b7bb7ab61193ceb47 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 56bd1b76d2e81c58a80bf6b5d74219c6b1ab8499) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix dependency chain that collects the metatype json filesAlexey Edelev2021-12-0313-0/+389
| | | | | | | | | | | | | | | | | | | | | cmake_automoc_parser has the logic preventing the run of moc with the --collect-json parameter if metatype json files are not changed. This logic only verify if the file list is changed but not their content. This change adds a timestamp file that contains the last metatype json file timestamp that was modified during the last cmake_automoc_parser run. The logic still prevents of running 'moc --collect-json' when the list of metatype json files is not changed, but also checks if their content is no changed. Another approach it to generate the depfile that can be utilized by CMake in add_custom_command as DEPFILE argument. But this concept only works from the second build attempt because of an issue related to dyndep. Fixes: QTBUG-98532 Change-Id: I713f8bfa9ae769cefe0beac0b7fa19750b00a765 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 63b8840380e70c1258f56c67a2ec5edb5bdea53d)
* QPA: Set focus reason when window activation changes focusVolker Hilsheimer2021-12-031-0/+36
| | | | | | | | | | | | | | | | | QApplication hides the fact that the reason is never set by several QPA plugins, but Quick items don't receive the correct reason on Windows, Android, the offscreen plugin, and other platforms. Add relevant scenario to the QFocusEvent test case, and fix the plugins to always set the focus reason when handling window activation changes. Exclude the minimal plugin from the test, it seems largely unmaintained anyway. Task-number: QTBUG-75862 Change-Id: I5404a225b387fc9a3851b6968d0777c687127ed1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit c034ad03ac6896b9fba8a72e01a1b7ec34cf0cd5) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTableView: correctly toggle column selection when scrolledVolker Hilsheimer2021-12-031-0/+56
| | | | | | | | | | | | | | | | | We need to check whether the horizontal header's selection includes the index for the row at the top, rather than for row 0, as the index we check is based on the scrolled position of the header, so would never be included in the top row when the view is scrolled. This is correctly done in selectRow already. Add a test case that simulates selection of rows and columns by clicking on the header. Fixes: QTBUG-98444 Change-Id: I2fa1b32bf75dc96225b40145b713bf7e2ffc29dd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit d22bafe3559afef1dcab1c9076f82ac224d012b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't let text table cells shrink below their minimum widthVolker Hilsheimer2021-12-031-1/+60
| | | | | | | | | | | | | | | We calculate the minimum width, but then use it only to make sure that the maximum width is at least as large as it. Without setting the layout struct's minimumWidth as well, table cells can be smaller. Add a test case. Fixes: QTBUG-86671 Fixes: QTBUG-97463 Change-Id: Idf4ad015938abb8d3e599e9a58e002f29c0067be Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 97cfd4940157817dd761fd02f2e6da4afc5b4a30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QFuture continuations/handlers to work with move-only callablesSona Kurazyan2021-12-022-0/+71
| | | | | | | | | | | | | | | | std::function, which is used to store the type-erased continuation lambdas, requires the passed callable to be copy-constructible. This makes impossible to use move-only callables with continuations/handlers. In particular, it makes impossible passing lambdas that are capturing move-only objects. The workaround is to store the continuation lambda inside a wrapper for the callable, which stores the move-only lambda in a QSharedPtr and can be stored in std::function, since it's copyable. Fixes: QTBUG-98493 Change-Id: I8b7a22fcf68dc132b3c533216a7a1665e9f9fb0a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 3be72253a6c8f469626d931b623f548cfe1e81a7)
* QFuture: support cancellation of continuation chain through parentSona Kurazyan2021-12-021-0/+126
| | | | | | | | | | | | | | | | | | | | This change allows canceling the chain of continuations attached to a future through canceling the future itself at any point of execution of the chain. [ChangeLog][QtCore][Important Behavior Changes] The chain of continuations attached to a future now can be cancelled through cancelling the future itself at any point of the execution of the chain, as it was documented. Previously canceling the future would cancel the chain only if it was done before the chain starts executing, otherwise the cancellation would be ignored. Now the part of the chain that wasn't started at the moment of cancellation will be canceled. Task-number: QTBUG-97582 Change-Id: I4c3b3c68e34d3a044243ac9a7a9ed3c38b7cb02e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit eab40726be98616b7edac3a600e97b39fc6227cd)
* Fix overlapping text for Osaka font on macOSEskil Abrahamsen Blomfeldt2021-12-021-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Osaka font on macOS has all zeroes in the OS/2 table, probably because it is not intended to be cross-platform. In Qt 6 (since f761ad3cd9ad1252f24b76ae413298dc7bed8af3) we are trying using the same vertical metrics on all platforms, but this only works if they are valid. To work around this issue, we detect the case when ascent/descent values are both 0, since this is very unlikely to be intentional, so we fall back to the system-provided ascent and descent in these cases. Adding the test also revealed that we had missed the check for a macOS-specific bitmap font format when skipping the check for bitmap fonts in 7a18b7e2c2394b2b2cc95833c755f91193d9ba2e. [ChangeLog][macOS][Text] Fixed a problem where using the Osaka font would lead to overlapping text. Fixes: QTBUG-96880 Change-Id: Ifea7918641a68829e8f5ef20a4fb61c0a7e5b757 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6b02473e1e4b559cb81c007a35a07746d843398c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix fail to activate first sub window with QMdiArea::TabbedViewZhang Yu2021-12-021-0/+57
| | | | | | | | | | | | | | | | | | | | The first sub window added will activate itself automatically, and isActive is set to true. Therefore the call to setActiveSubWindow to activate the first sub window will be ignored. When showing the mdiarea, all sub windows will be activated in the order in which they were added, so the active window will always be the last sub window added. Fix this by setting isActive to false so that setActiveSubWindow activates the first sub window when the mdiarea becomes active. Fixes: QTBUG-92037 Change-Id: Id4a793e2059803c1a4ada916fdae2d3cc02cdf06 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit c6c039167cfdbc28351a73cc0819461c69bc0451) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't shrink a column when it spans multiple columnsVolker Hilsheimer2021-12-011-0/+28
| | | | | | | | | | | | | | | | | | | If a cell spans multiple columns, then the merged cells' starting column's maximum width should never become smaller than what was calculated from previous rows. Otherwise, we'd distribute the space of the column that has a span across all merged columns, resulting in unnecessary line breaks esp if WrapAnywhere is enabled. Add a test case. Fixes: QTBUG-91691 Fixes: QTBUG-95240 Change-Id: Ic27dbdb128071e50fba049de85c9f23ba2f059b3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 9538c7ca73e75ab8219e43b36b49200f27164dbb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH: use unqualified qHash() lookupMarc Mutz2021-11-301-0/+26
| | | | | | | | | | | | ... instead of QT_PREPEND_NAMESPACE(qHash), which is qualified (prepends at least '::'), and therefore disables ADL. This is not a problem as long as we wrote our qHash() overloads as free functions (incl. non-hidden friends), but it should™ fail for hidden friends, so use the old using-std::swap() trick to bring QT_PREPEND_NAMESPACE(qHash) into scope, proceeding with an unqualified lookup. Change-Id: I00860b2313699849f86bfe3dd9f41db4ce993cd3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit ccaeffe5655cba23b4f708ec575e34f03cf08a1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNAM: Disable h2c by defaultMårten Nordheim2021-11-301-0/+1
| | | | | | | | | | | | | | | | | | | And since it's relatively unlikely to be used, just leave it behind a environment variable for now. [ChangeLog][QtNetwork][Potentially Source-Incompatible] Support for clear-text http/2 was disabled due to incompatibility with certain servers. If you were relying on this feature you must re-enable it by setting the QT_NETWORK_ALLOW_H2C environment variable. For a later version of Qt it will get a dedicated attribute. Task-number: QTBUG-98642 Change-Id: Id3e360726e285b3128e3e3f4bce9440404c9ad6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 4c930e9d13738ac0faaaed3aa5b1c34509b04019) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Check that QStringView::split() w/rvalue QRegularExpression returns valid dataMarc Mutz2021-11-301-0/+29
| | | | | | | | | | | | This test currently passes in Qt 6, but fails in Qt 5.15, thus the QT_VERSION check. Task-number: QTBUG-98653 Change-Id: I3c7b9bc7ef74f605ff63768b38c473296274d0de Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 8568a6386c1691e296e288021d7fd6316695cfbb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shorten target name for qsortfilterproxymodel auto testsOliver Wolff2021-11-292-2/+2
| | | | | | | | | | These long target names can quickly lead to exceeding Windows' max path length. Change-Id: Ibd77e53464a71221f9302d490afbe9c41c16646d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit a892a7b2caf4e915acb0cb1f6007d63c1d0fb40b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qhashfunctions: check qHashRange{,Commutative}() find hidden friend qHash()Marc Mutz2021-11-261-9/+27
| | | | | | | | | | ... extending the existing check for ADL-found qHash() implementations. Change-Id: Iac6ed2721db9e95ee921bd1d5170fa8c8d43475d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6f6aa316f1145b3e49abe4d2810d83220c66298a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Stabilize tst_QAccessibilityMacVolker Hilsheimer2021-11-261-12/+9
| | | | | | | | | | | Introduce a TRY_EXPECT macro that uses qWaitFor, and use it whenever EXPECT was used after a call to processEvents. Fixes: QTBUG-94036 Change-Id: Ia935444d529c2798637bf9b4a56e47a8dc9d75d2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 24022bc76080f1881755df839b41a1003a1ed125) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QHash: fix thread race around references and detachingMårten Nordheim2021-11-261-0/+56
| | | | | | | | | | | | If we detach from a shared hash while holding a reference to a key from said shared hash then there is no guarantee for how long the reference is valid (given a multi-thread environment). Change-Id: Ifb610753d24faca63e2c0eb8836c78d55a229001 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 8f8775adf3c4fbba1bd3c120a228351d46f50127) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAuthenticator: Filter out algorithms we don't supportMårten Nordheim2021-11-261-0/+31
| | | | | | | | | | | | Which is anything other than MD5 Fixes: QTBUG-98280 Change-Id: Ifbf143f233ee5602fed1594e3316e6b2adec1461 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit a92619d950fdbf803cdc8c8ca8e75c1c82abb23f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>