summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Fix alpha handling of QImage::setPixelv6.0.3Allan Sandfeld Jensen2021-03-231-11/+61
| | | | | | | | | | It was treated differently depending on format, made it consistently behave the same for all formats (following the behavior of the primary formats). Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c32cd44d34910cfd42e32537578e4a573138a282)
* Fix invalid pointer return with QGridLayout::itemAt(-1)Zhang Yu2021-03-221-0/+51
| | | | | | | | | | | QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound. If the index < 0, these function will return invalid pointer. Fixes: QTBUG-91261 Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit c47bb4478a4c3a29c0505d7d89755f40601b326f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslSocket::setSslConfiguration - skip if SecureTransport is in useTimur Pocheptsov2021-03-221-0/+4
| | | | | | | | | | | | | | SecureTransport does not allow deprecated digest algorithms, and (depending on ST version) it may or may not accept our server's certificate. Funnily enough, they 'fluctuate' between versions again and again. Fixes: QTBUG-89922 Change-Id: Ie5fbfca316806bd5000ce2d128b81b718bb36624 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 3d5f86e77d0740d72cd8922c7b1d4f8cde460ee1) Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows, take 2Friedemann Kleint2021-03-221-3/+5
| | | | | | | | | | | | | | Use the QWindow-based overloads of QTest::mouseMove(), which do not move the cursor position. Amends ba139603925453bf79994eca48b566d8f15b2af0, 3f3d5e6716d9130776b3613ccbd5595de7d4af8d. Task-number: QTBUG-89082 Change-Id: I2cc62e4d1f24e4baebafd0d76fbf0fbdb6f588c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 65c6fbea242e150d785ea0a7062188fdc090af32) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f226854d256a382a5cc7ff08b10a0d27fbefb0fe) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "QPushButton: fix support of style sheet rule for text alignment"Volker Hilsheimer2021-03-111-0/+18
| | | | | | | | | | | | | | | | | This reverts commit 6269438af95bbd988ead08829fa3bc9dc25891e8, and adds a test. This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The code already interprets the textAlignment values from the rule, also if no icon is set. Adding the same, or some default textAlignment to the text flags if there is no icon doesn't work. Fixes: QTBUG-91735 Task-number: QTBUG-86857 Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 674747bac1c8b57d4940de2ee68b6b562dfcad61) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QConcatenateTablesProxyModel: skip dataChanged in hidden columnsDavid Faure2021-03-091-0/+11
| | | | | | | | | | | | | | | | | When the source models don't have the same number of columns, the proxy keeps only the smallest number of columns across all source models. Afterwards, if a source model emits dataChanged in a column past that number (a "hidden" column), the proxy needs to ignore it rather than assert. But also, if the source model emits a dataChanged signal across both visible and hidden columns, then the last column number needs to be adjusted so that the signal is correctly processed and forwarded. Task-number: QTBUG-91253 Change-Id: I939e8ec0faf41370472f86785851292e4372f72c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit f6efbd23b59bcf75866ce47fb762c99f2e4a128a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: gl: Fix missing uniform data with certain command listsLaszlo Agocs2021-03-091-49/+170
| | | | | | | | | | | | | | | Following patterns from the other backends is insufficient with OpenGL because we do not use real uniform buffers. There is currently a possibility that a shader program will be bound without following it with setting uniforms. Correct this by having a second level of tracking of the associated srb object in the pipelines. Fixes: QTBUG-91630 Change-Id: I74a012daade826dd22c436bde06381c1233bad11 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 80029e0ca65d4bf4575f7a08d186c781ec6c2f0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the crashes when animated QTreeWidgetItems are hiddenQiang Li2021-03-081-0/+24
| | | | | | | | | | | | | | | | | | | QTreeView's drawTree implementation performs lazy layouting when calling itemDecorationAt. If animations are enabled, this can change the list of items, and invalidate the copy made earlier. Don't copy the list of items, use a reference instead so that code iterating over the items later operates on valid data. Add an assert in the private itemHeight method, it must not be called with an index that is out of bounds. Fixes: QTBUG-42469 Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f140ef04a0c54c2c8a699db33433b8d7235d137c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make qdecompresshelper archive bomb check only trigger for large filesØystein Heskestad2021-03-072-0/+40
| | | | | | | | | | | | | This is to avoid false positives. By default files are large if uncompressed size > 10 MB. Only configurable internally. Also add auto tests. Task-number: QTBUG-91392 Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit be73ca7eb1cebcc15064666e647bc337b5c2baa2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMenu test: turn tooltip animations offVolker Hilsheimer2021-03-051-0/+2
| | | | | | | | | | | QTBUG_89082_actionTipsHide() is very flaky if tooltips fade in, as the mouse move might happen while the tooltip is still appearing. Fixes: QTBUG-91532 Change-Id: I55305927fcf143d99dfff28d0bc70b2e831a139a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit d76d8571e2cc9172d2800e4b53f4b6941842dc6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist test QMenu::QTBUG_89082_actionTipsHide() for WindowsFriedemann Kleint2021-03-041-0/+1
| | | | | | | | | | | | Apparently, ba139603925453bf79994eca48b566d8f15b2af0 is not sufficient. Amends 3f3d5e6716d9130776b3613ccbd5595de7d4af8d. Task-number: QTBUG-89082 Change-Id: I80a00abb330bebd3be8667762c279c2eef595c7f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit b62725608bbc1a8924209bd733aefe9f0465c3a7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* And fix handling and test of QImage::fill(uint) as wellAllan Sandfeld Jensen2021-02-251-2/+8
| | | | | | | | | | Only RGB444 and RGB666 were treated slighlty different from the rest, but the test had a few additional mistakes. Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c2bec047e281d949015ecd27daf2ba2d51b21526) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix recently added auto test of text layout overflowv6.0.2Eirik Aavitsland2021-02-241-1/+2
| | | | | | | | | | Ignore width of trailing space. Fixes: QTBUG-91038 Change-Id: I74e278366a2c3b170335738bf6d6ee23933b361a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit be4127d6f747742c714914e1b313186422b438f3) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QJsonObject: Fix operator<=()Ulf Hermann2021-02-181-0/+31
| | | | | | | | | | | We had a copy-paste error there. Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a2e23bca0f2b43a26e2e489f83cfe2e521da63b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rework tst_QDateTime::toString_isoDate() to eliminate an XFAILEdward Welbourne2021-02-161-16/+17
| | | | | | | | | | | | | | | | Instead of an XFAIL, actually test what we expect will happen for the test, namely that the milliseconds will be lost. In the process, verify that milliseconds since epoch also matches what was expected, change an "expecting empty" condition to check for the "invalid" test-case to which it's actually relevant and note that this test-case shall need amended when we update our ISODate support to the 2019 update, which extends the year range. Task-number: QTBUG-56552 Change-Id: I680aa31ee0dcc8fadabb5d4cd6c083a8afd48573 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cc93dadf772480df3b27fd031a471047a5db0038) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qapplication: Prevent desktopaware test from deactivating main testTor Arne Vestbø2021-02-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Applications on macOS are automatically activated (put into the foreground), when launched from the Finder, or via 'open' on the command line. But when launched from the terminal, e.g. foo.app/Contents/MacOS/foo, the application will launch in the background (inactive). In Qt we override this behavior, activating the app even when launched from the terminal, as a convenience, as long as the application is a GUI application. Unfortunately this means that when tst_qapplication launches a subprocess that is a GUI app, it will steal activation from tst_qapplication, which in turn will break tests that later try to activate a window and check that the window is then active. The window will not be active until the application is active. We can work around it by preventing Qt from activating the application, but ideally we'd find a better solution to this, as we don't want to sprinkle overrides all over our tests. Fixes: QTBUG-90699 Change-Id: If53a86548002b739df0c0a7153d6244924a4a205 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 09cc63d425dabfa37b406e7eb1cee627c2eabb67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Extend colorspace testing and fix bug it uncoveredAllan Sandfeld Jensen2021-02-161-0/+119
| | | | | | | | | | | When changing transferfunction the look-up-tables needs to be regenerated. Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit b2631c72c0628e68c0fae7567fd12e6646455efc) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systemsEdward Welbourne2021-02-151-14/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test verified that a LocalTime's time since Epoch changes when the system time-zone changes. This works when the QDateTime object is in short form and recomputes its offset from UTC every time it is needed, but fails with a pimpled QDateTime, as this caches its offset from UTC when it is created, saving the recomputation which - in the far more usual case where the system time-zone does not change in the lifetime of a QDateTime object - would normally produce the same result. Changed the test to use a newly-created QDateTime constructed with the same parameters, which doesn't have the cached out-of-date knowledge of its zone offset. Removed the XFAIL. Made the test data-driven and added test-cases: one so close to the Epoch that it should be short even on 32-bit systems, one so far that it's pimpled even on 64-bit systems (used in reproducing the issue in order to debug it). This then revealed that Android 5 doesn't seem to support the POSIX zone IDs used by this test, so it now verifies that LocalTime has the expected offset from UTC after zone changes, QSKIP()ping if not. Documented that the behavior of LocalTime is undefined after a change to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec in the process. Fixes: QTBUG-89889 Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 02ae1b522193b60e7a5c8e5eff7a15d25b0f7aae)
* Fix QImage::fill with semi-transparent QColorAllan Sandfeld Jensen2021-02-121-7/+31
| | | | | | | | | | A few formats were not treating the input QColor correctly. Fixed and added more exhaustive test. Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 95712c5e5438e4eb5cd205ab4659febf3192137a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore pre-Qt6 QList::fill() behaviorAndrei Golubev2021-02-111-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 Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6512a7fc642c65455db770385c67cfa6d71c294c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflow in text layoutEirik Aavitsland2021-02-111-0/+13
| | | | | | | | | | Fixes oss-fuzz issue 29313. Change-Id: Idbabd162fa9e0dbce687981bdbcc75be37189a61 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit bfc09b8d8fa6c1a397aff458c644ed424754adf0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPlainTextEdit: adjust scroll bars when showing upWang Chuan2021-02-091-0/+32
| | | | | | | | | | | | The text of QPlainTextEdit might change when it is invisible, so an adjustment of scroll bars is needed when the QPlainTextEdit showing up, otherwise the range of scroll bars might be incorrect. Fixes: QTBUG-77937 Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 13ae47d98057c2ddca8c865b845973d7e4c8dd8b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle macOS 11 issues in softHyphens testAllan Sandfeld Jensen2021-02-081-17/+42
| | | | | | | | | | | Calculate the effective width of the hyphen better, and compare with ceiled sizes. Fixes: QTBUG-90698 Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 0ffdbb21261eee3a9ec1cd541478ee883a12065c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* a11y: Report mixed state if QCheckBox is PartiallyCheckedJan Arve Sæther2021-02-053-3/+7
| | | | | | | | | | | Previously it only returned checked or unchecked for a tri-state checkbox. Fixes: QTBUG-84616 Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f4887aca1e5ac7b90abf862d7c9828417a74a1b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove false Q_UNREACHABLE from shaping codeEskil Abrahamsen Blomfeldt2021-02-042-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was added by 9ff76c27b9031ae7c49c4c9e8b5a3bea1e0e3c78 on the basis that it signifies a shaping error and would later assert or crash. But the line is easily reachable by user code. If Harfbuzz returns 0 glyphs, it just means it is unable to shape the string, for instance if the input string only contains default ignorables (like a ZWJ) and does not have any appropriate glyph to use for replacement. Qt expects there to always be at least one glyph in the output (num_glyphs == 0 is used to indicate shaping is not yet done), so to avoid asserts later on, we simply populate the output with a single 0 token, which is a required entry in the font that is reserved for representing unrepresentable characters. This also adds a test and therefore a zero-width joiner to the test font to reproduce the issue. [ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts when shaping strings consisting only of control characters. Fixes: QTBUG-89155 Change-Id: Ia0dd6a04844c9be90dcab6c464bebe339a3dab11 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> (cherry picked from commit fccd419dd632306a4bd85928223e0a56a59510ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update public suffix list to today's latestEdward Welbourne2021-02-031-13/+18
| | | | | | | | | | | | | | | | | | | | | | Fetched from the authoritative source, verified the content matches that of the current master revision in the github repository. Amend one cookie jar test to find the last group in the last chunk correctly - each group arises from a non-empty hsah-table entry, but the last few hash-table entries may be empty, in which case the last group isn't just before the last index, it's earlier by the number of empty hash table entries. In the process, amend this test and the related test of the end of the first chunk to iterate all the entries in the group (in the present version, as it happens, each end-group has just one entry, but that may vary). Task-number: QTBUG-90214 Change-Id: I6da365a6ca558124f8275e392735071dc77e04bb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit ad16f79e5fac13f8a9dab8604de6adb6c46fe7bd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct string comparison in Android's IANA ID matching codeEdward Welbourne2021-02-022-31/+11
| | | | | | | | | | | | | | | | | | | | | | It used QString.compare() and assumed it was returning a bool true on equality, when it actually returns an int that compares to 0 as the given strings compare. So it should use compare() == 0. This fixes several of QTimeZone's blacklisted tests on Android and a crasher, which we dodged with a QSKIP. Added an id-comparison to a test. Gave two local variables more informative names, made an early return into a QSKIP so it explains itself. Fixes: QTBUG-89905 Fixes: QTBUG-69122 Fixes: QTBUG-69132 Fixes: QTBUG-87435 Change-Id: Icf18ed5a810143d6e65d36e34a70e82faac10b8e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 6ee13db700eecd8dfed54a9ec2d1081b39511562) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix handling of Sunday in POSIX time-zone rulesEdward Welbourne2021-02-011-11/+18
| | | | | | | | | | | | | | | | | | | | | | Dating from the origins of our support for the zoneinfo file format, the mapping of POSIX's day-numbering (0 = Sunday through 6 = Saturday, see [*]) to Qt's (1 = Monday through 7 = Sunday) was done by mapping 0 to 1, when it should have been 7. [*] http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html Corrected a QTimeZone test that trusted the results it got without checking which day of the week those were: they were all Mondays. Verified that the corrected dates are in fact Sundays. Checked the zone abbreviations, too. Fixes: QTBUG-90553 Change-Id: I84b4b14f9892ff687918cd3c42c7c9807e45313c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 38a72af4fd311219779f89b2b78cd56d879f61db) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QIcon: Use the @nx pixmaps in the paint methodBastien Bouclet2021-01-291-0/+48
| | | | | | | | | | | | Make use of the device pixel ratio in the QIcon paint method so the @nx hi-dpi pixmaps are selected when appropriate when painting to a QPainter. Fixes: QTBUG-90042 Change-Id: I53995a2285ef879e3c4fddb9f8da702e256a260f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit b69b04c4790f319104a1098147cea9405b6e7062) Reviewed-by: Bastien Bouclet <bastien.bouclet@gmail.com>
* Stabilize tst_QListView::internalDragDropMove() on X11Friedemann Kleint2021-01-271-1/+3
| | | | | | | | | | | | | | The test was flaky in recent test runs on X11. Debugging showed that the global position of the synthesized mouse events was not correct due to the window not being mapped properly. Use QTest::qWaitForWindowActive() instead of QTest::qWaitForWindowExposed() to ensure that. Task-number: QTBUG-90016 Change-Id: Ie1bc4157e6d0e807d8530f70dcbd27b5e2fc813c Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 58496196071ec817d141c14fe373939ae0df6383) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJsonObject::take: add missing detach() callThiago Macieira2021-01-271-0/+19
| | | | | | | | | | | We were modifying shared objects. Fixes: QTBUG-89625 Change-Id: Id6bc735b79cf4beb9454fffd165c56476a5dec04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 00b759a8d06dbec42232b1b8748c0725da7ced00) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I8176a4cc79f100ee772b09425e88fe8ff3ae226a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 37e26d2b3011acc86bbda1e1f46114d7c8441915) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Hardcode a special case of using qOverload for slots without argumentsJarek Kobus2021-01-2147-77/+181
| | | | | | | | | Fixes: QTBUG-90308 Change-Id: I35cd45679ded626654dd0e7e3eea8a7bb14c1d56 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 98a89fb711a15fcf9f541f7b4a8ae7492e5a445c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_socketnotifier: Fix timeout of QTcpServer::waitForNewConnection()Friedemann Kleint2021-01-211-2/+2
| | | | | | | | | The timeout defaults to 0, give it 5s. Change-Id: I975810a1ecee8bb8b3a3f143f1379a9a09589a40 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> (cherry picked from commit ad84332f2bbe10601ba4c21fd6d4a446d16ed94c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add new special QObjectPrivate::{connect, disconnect} for QMLAndrei Golubev2021-01-211-0/+28
| | | | | | | | | | | | | | | | | Original QML-specific connection mechanism ignores the receiver argument and uses sender as receiver. This causes uncontrollable memory growth in certain cases as connections on receiver persist even after receiver is destroyed New connect() with receiver parameter uses underlying API correctly, disconnect is provided for the symmetry (not sure it's really needed) Task-number: QTBUG-86368 Change-Id: I4580d75b617cb2c4dfb971a4dfb8e943e325572b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6f520abdab7120789800208dde837b3836f762cc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix lancelot GL painting test for GLESEirik Aavitsland2021-01-201-5/+8
| | | | | | | | | | RGB10 internal texture format is not supported on GLES, use RGB10_A2 instead. Change-Id: Ib43eb99b170f441e886be50d29a6a5f7696c05c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 167bcafcb6b1988047bec8b4d67c994fc8c85c14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_socketnotifier/unexpectedDisconnection: Extend blacklisting to all ↵Friedemann Kleint2021-01-191-2/+2
| | | | | | | | | | | windows versions The test has been failing frequently, recently. Change-Id: I3ae00a64f67e4b6a0b5ade0c660805f4d12f8317 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0b4717097ebf9614937a03407e741267a6d39a39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: skip tst_QFile::moveToTrash()Assam Boudjelthia2021-01-192-3/+3
| | | | | | | | | | | Android doesn't have a trash bin, so this test is not valid for that platform. Fixes: QTBUG-89398 Change-Id: I119b25682ba18e18466b5687cae369445dc73311 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0392dce4f0a2093987ab45c48f0748c3dd97e7fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix problems with offset-derived ids for QTimeZoneEdward Welbourne2021-01-192-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a time-zone from a UTC+offset name that isn't known to the system, QTimeZone (since the fix to QTBUG-77738 in 5.15.0) falls back to constructing a suitable UTC-offset backend; however, the id of this is not guaranteed to match the id passed in to the constructor. In all other cases, the id of a QTimeZone does match the id passed to its constructor. Some utcOffsetId testcases had different id() than the id passed to the constructor, due to mismatches where a zone was constructed using the fall-back but the generated id included its minutes (as :00) or omitted its seconds. The omission of seconds is clearly a bug, but we also don't want to include :00 for seconds when it's not needed. So change QTimeZonePrivate::isoOffsetFormat() to accept a QTimeZone::NameType to configure how much we include in an id. Its callers other than the relevant constructor (from offset) still get minutes, even when :00, but will also get seconds added if that isn't zero; and the constructor from offset now gets the short form obtained by omitting all trailing zeros. Since all valid whole-hour offset names that do include :00 for the minutes field are in fact known standard offset names, the elision of minutes will only affect zones created by ID in the case of a whole-hour offset given without :00 minutes specifier, so these shall necessarily in fact get the ID passed to the constructor. Creating by UTC-offset with a name that specifies zero seconds will result in a QTimeZone instance whose id() differs from what was passed to its constructor (eliding the :00 seconds and potentially also minutes, if also zero) but this should be the only case where a QTimeZone's id doesn't match the one passed to the constructor, when constructed by id. Fixed inconsistency between the offset-constructor's declaration (taking offset as int) and definition (taking qint32) in the process. Added an id check to the utcOffsetId() testcase. Amended two tests of offset-derived time-zones' IDs, added comments to make clear how one of those differs from a matching standard name test and converted two uses of QCOMPARE(, true) to QVERIFY(). [ChangeLog][QtCore][QTimeZone] QTimeZone instances created by offset from UTC (in seconds) shall now only include minutes in their ID when the offset is not a whole number of hours. They shall also include the seconds in their ID when the offset is not a whole number of minutes. Task-number: QTBUG-87435 Change-Id: I610e0a78e2aca51e12bfe003497434a998e93dc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 50c63446f525a8625b6315597cb0897d89908d6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix setting active window as application's focus widgetSona Kurazyan2021-01-151-0/+40
| | | | | | | | | | | | | | | | | | | | | | | When setting the application's focus widget we search for the next child widget that can hold the focus and call its setFocus() method, which also updates focus widgets of all its parent wigets. In case if the focus widget is the active window itself, we only set it as the application's focus widget, but we don't update the focus widget of the active window itself. Because of this the focusWidget() method always results nullptr for the active window. This prevents from setting the focus back to active window after the focus has changed (for example after a context menu is closed, as in the bugreport). Transfer the focus to active window by calling the setFocus() method, as it is done in case of transferring the focus to any other widget. Fixes: QTBUG-85846 Change-Id: I91ebf182fd5bb7d451a1186e2f3e38c8d48acc4e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 154573929a76d9051920756b19ed033c4b2ac649) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the tips still show when cursor move to another actionQiang Li2021-01-152-1/+57
| | | | | | | | | | | | In this case, the previous action's tip is still displayed when the cursor moves from one action with tip to another action without tip. Fixes: QTBUG-89082 Change-Id: I0a00595dc3d716725678487be9cbb363c4d3b392 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3f3d5e6716d9130776b3613ccbd5595de7d4af8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QApplication::font returns the font unstable according to the objectChunLin Wang2021-01-151-0/+42
| | | | | | | | | | If a default font was not registered for the widget's class, it returns the default font of its nearest registered superclass. Fixes: QTBUG-89910 Change-Id: I6e6b2c6a0044462f84db9f76a03be0c6cfaaae8e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dafd26acbe7b08f5ddfe60432fe0e49422ac085c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Widgets: fix setTabOrder for QAbstractSpinBox-like widgetsIvan Solovev2021-01-141-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setTabOrder was not considering the case, when a child widget has its focus proxy set to its parent widget. This happens, for example, for the QLineEdit that is nested inside the QAbstractSpinBox. For such cases the lastFocusChild was calculated incorrectly, and, as a result, such child widgets were not correctly positioned in the focus chain. This could lead to an error while backtabbing. Here is a brief example. Suppose we have 3 widgets arranged like this: auto spinBoxOne = new QDoubleSpinBox; auto spinBoxTwo = new QDoubleSpinBox; auto button = new QPushButton; Then the default widget focus order is: - spinBoxOne - lineedit (from spinBoxOne) - spinBoxTwo - lineedit (from spinBoxTwo) - button Before this commit setting the explicit tab order changed the focus order in the following way: QWidget::setTabOrder(spinBoxOne, spinBoxTwo); QWidget::setTabOrder(spinBoxTwo, button); - spinBoxOne - spinBoxTwo - button - lineedit (from spinBoxOne) - lineedit (from spinBoxTwo) In this case, backtabbing from spinBoxOne actually leads us to lineedit (from spinBoxTwo), which refers to spinBoxTwo. And so we're stuck in a loop. This commit fixes the issue by handling such special case, and preserving correct focus order. Note: the actual unit-test in this patch uses QLineEdit instead of QPushButton, because one can't tab to buttons on macOS by default. However the general idea is the same. Fixes: QTBUG-81097 Change-Id: I5d16da7733a4d63f809cab28b8ca9e116b87cffa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 00505ed2b57d0a6911c8274af2bff883a93f583a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* AA_SynthesizeTouchForUnhandledMouseEvents: keep correct coordinatesShawn Rutledge2021-01-141-6/+13
| | | | | | | | | | | | | | | | | | | | | | QGuiApplicationPrivate::processMouseEvent() sends a QWindowSystemInterfacePrivate::TouchEvent if the mouse event is not accepted and AA_SynthesizeTouchForUnhandledMouseEvents is enabled. A QPA TouchEvent always contains native touch points, which is why it calls QWindowSystemInterfacePrivate::fromNativeTouchPoints to translate the QMouseEvent's device-independent position back to the raw position that it would have had if it came from a real touchscreen. Therefore we must give that function touchpoints that are actually in native coordinates. It may be that some of this transformation could be avoided entirely, but here we prove that the existing way works correctly, by adding coordinate checking to the tst_QWindow::mouseToTouchTranslation() test. Task-number: QTBUG-86165 Change-Id: I4c9ca2b11e9eb76d79712c187db3eb9865da581a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit aeeac48cbdea744406f0c8abefe271f571b61d07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_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. Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit d2e2d0d3a6249ccbc17ec92acb32fec9a0d71807) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QtDBus includesDavid Skoland2021-01-1327-109/+191
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9e09677c1dd4da92735736a0fbcb703416bf4d6d)
* Set the PlaceholderText color in the palette from the stylesheet as wellAndy Shaw2021-01-121-0/+16
| | | | | | | | | | | The color should be used across the board, so the PlaceholderText color should also be respecting the one passed for Text and so on. Fixes: QTBUG-89815 Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bb00b63dee85bfe77bd721dd962c768e62c1b1e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: exclude failing tests for tst_QPlainTextEdit on AndroidAssam Boudjelthia2021-01-121-0/+10
| | | | | | | | | | | | The Android tests were marked insignificant for some days, due to an emulator issue, these tests slipped during that time. Exclude them now to bring Android tests. Task-number: QTBUG-89402 Change-Id: I96d0f87b36975b7e2c83956b04b6569a03a781a9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit a0ee0118651d97381f892e24b789ac392a2d8be7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: exclude tst_QFile::moveToTrash on AndroidAssam Boudjelthia2021-01-121-0/+3
| | | | | | | | | | | | The Android tests were marked insignificant for some days, due to an emulator issue, these tests slipped during that time. Exclude them now to bring Android tests back. Task-number: QTBUG-89398 Change-Id: Ia65a0ae8d7474fd2554dda299a60371dbbc9dddb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b036ca33475a45298e383aa0d42f072d21e5a9df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>