summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add missing version bump from '6.2.0' to '6.2.1'Jani Heikkinen2021-10-132-2/+2
| | | | | | | Fixes: QTBUG-97458 Pick-to: 6.2 Change-Id: I1379a55e7180f1f37a8f8fb5ff27d244785a2145 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix handling of time-zone gap in QTimeZonePrivate::dataForLocalTime()Edward Welbourne2021-10-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was handled correctly when the backend supplies transitions bracketing the time in question, but the fallback code tried to use the DST offset at the time with larger offset from UTC; this did not work when the gap was due to a change in standard time. Discovered by ANS1 parsing of a date-time with two-digit year, for which the date-time parser tried to use 1921-05-01T00:00 local time when filling in the fields it had parsed; but, when run in Europe/Helsinki, there is no such time due to the 20m 11s skipped when joining EET from the prior local solar mean time. Correct the calculation to use the actual change in offset from UTC, as used in the (far better tested) between-transitions branch of the code, rather than the DST offset after the transition. Add a test-case based on the ASN.1 certificate date whose parsing revealed the issue. Although it seems nothing in Coin can reproduce the issue, the reporter has verified that the test does indeed fail on the system where the bug was found and the fix does fix it. Fixes: QTBUG-96861 Change-Id: I12b02bad01daca2073d1a356452cd573684aa688 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ba23507960a80367d918468d9d7da39c92a09fbf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix caching of parsed border color values in CSS parserVolker Hilsheimer2021-10-121-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing CSS, a border-color value is parsed as four brushes, as css allows assigning up to four values, one for each side. When applying the CSS to the HTML, we accessed it as a color value, which overwrote the parsed value with a QColor. So while we had a valid parsed value (and didn't re-parse), the code accessing that value still expected it to be a list, and thus failed to retrieve the data. There are several ways to fix that, but the cleanest way without introducing any performance penalty from repeatedly parsing (and in fact removing a parse of the string into a color) is to enable colorValue to interpret an already parsed value that is a list without overwriting the parsed value again. To avoid similar issues in the future, add assert that the parsed value has the right type in brushValues. As a drive-by, speed things up further by making use of qMetaTypeId being constexpr, which allows for it to be used in a switch statement. Add a test case. Fixes: QTBUG-96603 Change-Id: Icdbff874daedc91bff497cd0cd1d99e4c713217c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 8513bcd90cc3900f9c32e59e0823f621ea6eea1d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QList::iterator: use templates for advancing operatorsThiago Macieira2021-10-121-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | Because of the addition of the operator T*(), the expression "it + N" where N was not exactly qsizetype but any other integer type was a compilation failure because of ambiguous overload resolution. With GCC it's apparently a warning: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: note: candidate 1: ‘QList<T>::iterator QList<T>::iterator::operator+(qsizetype) const [with T = char; qsizetype = long long int]’ note: candidate 2: ‘operator+(char*, ptrdiff_t {aka long int})’ (built-in) With Clang, it's an error: error: use of overloaded operator '+' is ambiguous (with operand types 'QList<int>::const_iterator' and 'ptrdiff_t' (aka 'long')) note: candidate function inline const_iterator operator+(qsizetype j) const { return const_iterator(i+j); } note: built-in candidate operator+(const int *, long) Fixes: QTBUG-96128 Change-Id: Ie72b0dd0fbe84d2caae0fffd16a06f23dd56b060 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 878b2047b52c93e904eb46ef1044819a8b5614ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Activate tst_QWidget_window::tst_showWithoutActivating on cocoaVolker Hilsheimer2021-10-121-8/+8
| | | | | | | | | | The test passes, the functionality is implemented in QCocoaWindow. Task-number: QTBUG-8857 Change-Id: I2f4b3a39cec1aaaf4351753b590f35e280503461 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 971bf3a9bbbc4daa10ff1f6fd24b911faf2c8c7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Activate tst_QDialog::showAsTool test on macOSVolker Hilsheimer2021-10-111-3/+2
| | | | | | | | | | | | The skip-reason only cites Qt/X11. Convert the #ifdef into a platform name check instead. The test also fails with the offscreen plugin, so skip it for that as well. Change-Id: I49607b89f4b32359e81e1d9aadff2c3e03035c53 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 9d26de4069b9899788212ab4314c3e13dd65e223) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDialog: respect WA_ShowWithoutActivatingVolker Hilsheimer2021-10-111-0/+29
| | | | | | | | | | | | | | | | | | | QDialog overrides setVisible to set focus on the default push button, or (if there is no such button), make the first autoDefault push button the default button. QDialog also explicitly sends a FocusIn event to the focus widget in the dialog. All this should not be done if the dialog does not become active after getting shown, which will be prevented if the WA_ShowWithoutActivating attribute is set. Add a test case. Fixes: QTBUG-8857 Change-Id: If47021a4721a280ba45e95b43d0424cdacd9b4ea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 44b9aec8d900af77281f2e9209d54e946ee2fe76) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Reduce the width of a hfw-widget if scrollbar would be flippingVolker Hilsheimer2021-10-111-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | For a widget that implements height-for-width, the vertical scrollbar becoming visible might be just enough to make the scrollbar unnecessary. In that situation, the scrollbar flips on and off continuously. To avoid that situation, make the width of the widget smaller until the height fits without scrollbar, up to the point where we have space for the scrollbar anyway. The calcuation here is assumed to be cheap, but depends on the heightForWidth implementation in the widget. Running the while-loop a few dozen times should have no performance impact during resizing and laying out the scroll area contents. Add a test that confirms that within a brief period of time we only get the one hide-event we expect. Done-with: Zou Ya <zouya@uniontech.com> Fixes: QTBUG-92958 Change-Id: I0faeb5f9b1a226aada958c18333d9c2ac8203dd1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 6c4dc722cb9bf765904feefff4fb00bdb0b3dc9f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Http/2 - handle PADDED flag correctlyTimur Pocheptsov2021-10-111-0/+84
| | | | | | | | | | | | | Previously, when deciding where the actual data is, Frame was calling padding() to test if offset is needed. A curious case with a DATA frame containing compressed body and having 'PADDED' flag set with a padding equal to ... 0, ended in a decompression error (and assert in 6.2 code). Fixes: QTBUG-97179 Change-Id: I9341a4d68510aa4c26f4972afdcd09a530d5a367 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit dd57605b9ef4e12805868962efce586e57e342b6) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCocoaWindow: Make window key if the app's modal window is hiddenDoris Verria2021-10-081-0/+21
| | | | | | | | | | | | | | | | | | | | | On macOS, when showing a window, we decide if it should be made key and therefore active, if the app has no active modal session or if the window's worksWhenModal returns true. However, the window needs to be made key also when a modal window is present, but not visible. Add this condition when checking if the window needs to be made key. This makes the behavior consistent with what happens when a modal is minimized on macOS. The input focus is passed to the next window, and the window appears active, even if it can not be interacted with. Fixes: QTBUG-85574 Change-Id: I204d4f912128f4a46840789fc2ee08e1b2716bfc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 911c97f2b59945093e9e87130d687c6a2a9423ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add a basic round-trip test for QStringConverterEdward Welbourne2021-10-081-1/+56
| | | | | | | | | | | | | For now it only has a trivial test (empty) and an all-surrogate test (Chakma digits) - but at least now all conversions to and from UTF-16 are tested. In particular, there were previously no UTF-32 tests. Change-Id: I9317928a88b9990530126db80e4756b880a364df Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f644a122125feb799a02f4a3fb0f0fa51b8a14ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't build tests/auto/tools when cross-compilingJoerg Bornemann2021-10-071-1/+1
| | | | | | | | | | There already was an attempt, but the wrong variable name was used. Change-Id: I4bdd73f86ff6aa5151e4427024b83daa57b54a39 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> (cherry picked from commit 6f1eb0b2bc7f52f41ac9be05f18a4ec9d28727a1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Compile private Qt APIs autotests for INTEGRITYTatiana Borisova2021-10-052-2/+3
| | | | | | | | | | | - getgrgid/getpwuid are not supported - the default constructor of "ObserverOrUninit" must be referenced for GHS compiler Task-number: QTBUG-96176 Change-Id: I24093da76e116aba4b87a8f5c5763b03d082a2cd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit d093683119cb045f116d96309493d08005ad27e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove qshadergraph filesJuan Casafranca2021-10-0511-3815/+0
| | | | | | | | | | | | | - Those files were moved as part of Qt3D as its the sole user of these - Also removed associated unit tests Change-Id: I302bc219218a58071c86d2447cb4449601fca32c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit 0263cfdfa0162162df07d4a15f896c20a6aac9d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFontCache: don't start cleanup timer if we are not in the main threadVolker Hilsheimer2021-10-011-0/+47
| | | | | | | | | | | | | | We can only start timers in threads started via QThread, and even then we cannot assume that the thread runs an event loop. So only start the timer when we are in the main thread. Add a test that verifies that we don't get the warning message. Change-Id: I40d7d9ff115720f9ecd3eedaebbade2643daf843 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 132d6d012701ce00a4ff82eae5b14e560632e893) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAbstractItemView: Fix IM input starting edit sessionVolker Hilsheimer2021-10-011-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Item views can open an editor widget on the first key press, and need to take special care not to break input methods. The initial key press starts compositing by the system input method, which is then interrupted by the focus transfer to the editor. To solve this problem, the widget needs to keep focus while the initial composition is ongoing, and only transfer focus to the editor once the composition is either accepted or cancelled by the user. Add a state flag that is set during this initial preedit phase. During this initial composition, the item view will receive all input method events, and needs to forward these to the open, but not yet focused editor for the user to get the correct visual feedback during the preedit phase. The item view also needs to report to input method queries on behalf of the editor to make sure that the IM UI is correctly positioned without covering the user input. Implement a test that simulates the sequences through synthesized QInputMethodEvents; we can't simulate the entire system input stack. Fixes: QTBUG-54848 Change-Id: Ief3fe349f9d7542949032905c7f9ca2beb197611 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 79f62380f09988949bc601060ff5131cf34de872) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qthread: Don't use QVERIFY in multiple threads in threadIdReuse()Ievgenii Meshcheriakov2021-10-011-2/+5
| | | | | | | | | | | Testlib is not thread safe. Store the status into variable and check it in the main thread instead. Change-Id: I840c8a3dceb1115a1b81ffeaa0fab96f9d2f1ff0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e0b87edd73c4ade9f35985313b19d8f2f1f9ca78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QDir::entryList to work for directories that end with '.lnk'Karsten Heimrich2021-09-304-3/+6
| | | | | | | | | | | | | | In addition to checking the .lnk extension, check that the the specified path is not a path to a directory. Fixes: QTBUG-85058 Change-Id: I83cef3d94c6ffa82a88f374c5b41779e88fe40b8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 55ab987c9a518f217c02ca1382656ac97c53b307) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QThread: Reset the system thread ID when thread exits on UnixIevgenii Meshcheriakov2021-09-291-0/+53
| | | | | | | | | | | | | | | | | | | | | | Unix QThread implementation stores pthread_t as a system thread ID when the thread is created, but never resets the system ID when those threads are destroyed. Some implementations may reuse the same thread IDs for new threads, and this may cause QThread::wait() to erroneously complain that "Thread tried to wait on itself". This patch sets the system thread ID to nullptr when the thread is about to exit and be destroyed by the system. A regression test is added to tst_qthread. Fixes: QTBUG-96846 Change-Id: I0850425dd0e09af50e59c9038e7e662a2a624beb Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 52ad59f9eabbe1fc8ca49d117e4955f2d21d50a7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't clear focus if setParent doesn't change the parentVolker Hilsheimer2021-09-282-0/+90
| | | | | | | | | | | | | | | | | | | | | QWidget::setParent might be called to change the window flags, without changing the parent. For those cases, we don't have to clear the focus. Decouple the newParent state from the wasCreated flag. In most places where newParent was tested, wasCreated was either tested previously and can't be false anyway, or the code executed is irrelevant for widgets that are not yet created (there can't be a paint manager). In the remaining case, test wasCreated explicitly to maintain existing logic. Add test for the cases where the previous code broke the focus, both for QWidget and QDialog. Fixes: QTBUG-93005 Change-Id: I39dc179c2d348054de3927aa8b69eecef4935511 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 223066d4319d611e724da69089c8f49d525a2566) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add testing of QPdfWriter output to QPainter lancelot testEirik Aavitsland2021-09-282-1/+103
| | | | | | | | | | | Utilizes the native pdf renderer of macOS, so the test is only enabled on that platform. As the PDF generation should be platform independent anyway, this should not matter. Change-Id: I8b6b70562d1f24fdb77795aa7eb5843279aaae85 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 5e2725772aa25e0ee95269c8f996fdb7bc4705e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Preserve QImage metadata when converting format with color tableEirik Aavitsland2021-09-281-0/+7
| | | | | | | | | | | Unlike the other conversion functions, convertWithPalette() did not call copyMetadata(). Fixes: QTBUG-96926 Change-Id: I2b171cec16bc5a90d33e80d6fe178c650ed3fe36 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 66a44f4ebac0dc20422477afe794fa712dea01bc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qplugin{,loader}: make it pass on MacsThiago Macieira2021-09-241-6/+6
| | | | | | | | | | | | | | | | Debug builds were broken. WARNING: tst_QPluginLoader::errorString() testdata bin/libtst_qpluginloaderlib.dylib could not be located! $ ls -l bin total 112 -rwxr-xr-x 1 tjmaciei staff 77296 Sep 14 08:46 libtheplugin_debug.dylib -rwxr-xr-x 1 tjmaciei staff 33408 Sep 14 08:46 libtst_qpluginloaderlib_debug.dylib Change-Id: I42eb903a916645db9900fffd16a4bb0a51ef967c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 60b0b0dedd87ab4f8a842e7f1650d5c96e731c38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: send enter/leave when a window opens/closesVolker Hilsheimer2021-09-241-3/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since macOS doesn't give us any event when a modal window opens, we need to do so ourselves explicitly so that the current mouse window gets a leave event when e.g. a popup opens, and an enter event when the popup closes again. The case for modal dialogs is partially handled by QGuiApplication already. Note: We cannot rely on the transientParent of the opening/closing window, as it's nullptr for QMenu windows even if the QMenu has a widget parent. Add a test for enter/leave events when a secondary window opens, covering both the dialog and the popup case. For the dialog case, we sometimes get two Enter events when the dailog closes, which we have to tolerate for now. To make the test pass on b2qt platforms, fix the offscreen plugin to explicitly send enter/leave events in the same way as Cocoa now does. Fixes: QTBUG-78970 Change-Id: If45e43e625e8362c3502c740154f6a6a8962b9e9 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 a5e5943d8a7d2a1345dc94dad0a97cf2966f6e7b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "QProcess: do not emit aboutToClose() twice"Alex Trotsenko2021-09-241-2/+0
| | | | | | | | | | This reverts commit e991478372e077db92d6808e44f44e065c3bc0e3. Reason for revert: behavior change for signal listeners Change-Id: I62ac317116d1453554fe8af0effdeddc1d5d4041 (cherry-picked from d3a622f8173c3c9cde4b29f7c984c7c48bfc18cc) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-2453-53/+53
| | | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Task-number: QTBUG-95018 Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 0da123d67b0fd332691f98ae6957ef05e9e20e84) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* locale: INTEGRITY does not define LC_MEASUREMENTSTatiana Borisova2021-09-221-2/+2
| | | | | | | | | | - It does however use the Unix backend for system locale, so don't entirely skip setting environment variable, only leave out LC_MEASUREMENTS. Change-Id: If292f1077851b29da2a21af7c46f4db9c0e4ed19 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit dbab92688319fdb33f5177adb2572fc954ddebe0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qmetatype: Fix operator< detection for std::optionalFabian Kosmale2021-09-211-0/+2
| | | | | | | | | | | Amends ca54b741d6edda24773137aacee229db31dd3585. operator< is not constrained in MSVC's standard library, either. Fixes: QTBUG-96690 Change-Id: Ibcbb9e53a1f9e8b13786f6d8c01489c61d8d2d7f Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 01d94760d8d34e51e1442682fc151747943c7e25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* locale: QNX does not define LC_MEASUREMENTSPasi Petäjäjärvi2021-09-211-1/+4
| | | | | | | Change-Id: I01ce03e578173f53639927e70f49e6d9b0d08d20 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 3635acd27a41e2e63646c09ece294cdb1a6cbf2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Compile autotests for IntegrityTatiana Borisova2021-09-2137-43/+132
| | | | | | | | | | - process environment/DNS are OFF for INTEGRITY Task-number: QTBUG-96176 Change-Id: I189a97f88c96a428586c31a66b8d250e04482900 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 766904bf5b776a6437ca974efbeb9e99ef13e084) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: Actually compare names case insensitivelyMårten Nordheim2021-09-201-0/+1
| | | | | | | | | | The docs (10 lines above) say it will find the backend case insensitively. Thus the comparison should also be case-insensitive. Change-Id: I65901ed81b7d8bdfcf76f5b6c7b40efe63245503 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 810e4e56bdf958a16723cef19cbfd1aa2ba6e942) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Eat expected warning messages in QGuiApplication testVolker Hilsheimer2021-09-201-0/+9
| | | | | | | | | | Verifies that we get the messages we want, and makes it easier to see relevant debug output. Change-Id: Ide92959b120f325badbf200236cdc85f72226e1e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 8fcfd7f59136be08bb418b9f26910af8405faf13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWidgetWindow: Stabilize test on XcbVolker Hilsheimer2021-09-201-0/+1
| | | | | | | | | | | | | | | | | | Showing, hiding, and showing a window can result in the Xcb QPA plugin warning about qt.qpa.xcb: internal error: void QXcbWindow::setNetWmStateOnUnmappedWindow() called on mapped window The point of the test is to verify that we get a paint event on a window that is shown again after having been hidden, not to verify that async windowing systems can handle a show/hide/show sequence. So wait for the window being exposed before we hide it. Change-Id: If91a9926613645e78e332dacff34bd57e4034b6f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 3714e51436eebb64873c58dc36cf89ef8f139f09) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist flaky testDimitrios Apostolou2021-09-201-0/+3
| | | | | | | | Task-number: QTBUG-96270 Change-Id: I3feb604c0c2f394b2915b3d98d3b02f469331a18 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a5d501000ea4eb9d282ed0a15e7c5fb1e1837712) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: Remove Q_RELOCATABLE_TYPE for types with QVLA in themLaszlo Agocs2021-09-201-0/+46
| | | | | | | | | | | | | | QVLA itself is non-relocatable due to self references. (ptr pointing to array[Prealloc] as long as capacity < Prealloc) Seems we shot ourselves in the foot in multiple places with this. Fixes: QTBUG-96619 Change-Id: I57a2ce539b671326cd352dbe57a1f3d4c46a6456 Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 481bc82d5931d5c715c2e889da6f249aa88057de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProcess: do not emit aboutToClose() twiceAlex Trotsenko2021-09-191-0/+2
| | | | | | | | | | This signal is emitted by the QIODevice itself, so we don't have to emit it from QProcess::close(). Change-Id: I9165b3eebadc17a66cc834d5ef54441d13f23d7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit efb90f6e7ed3e8d4f7b6c0fb96012cb3a9a9d037) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rework tst_QString::remove_regexp() and its data tableEdward Welbourne2021-09-181-30/+36
| | | | | | | | | | | | | | | | | | | | The test was producing a warning about the invalid test, for which replace_regexp() had anticipated that warning; do the same in remove_regexp(). The two tests shared a date() method, but the remove test was a no-op on the tests with non-empty replacement text; move the column set-up and data rows with empty replacement to remove's data() function, from replace's, and reverse the direction of calling each other between data() functions, so each test gets the cases that are relevant to it and no spurious PASSes happen for no-op tests. In the process, give moved test-cases informative names; relocate the (entirely re-written) remove data function to beside its test; and eliminate a pointless local variable from both tests (it used to be needed when testing both QRegExp and QRegularExpression). Change-Id: I93dcfc444f984edf5c029f99306aff6bc95d554a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 826e1963e3f3a821f31c2457242c4055f9820b0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: vulkan: Reset state more aggressivelyLaszlo Agocs2021-09-171-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | ...when starting a render/compute pass. This matches most other backends in fact, the Vulkan backend has just certain historical differences, and is complicated due to the fact that it has the option of using secondary command buffers for passes that specify ExternalContents (to support the case of wanting to issue direct Vulkan commands in a code block surrounded by calls to beginExternal and endExternal). Not resetting state such as the currently bound index buffer when starting a pass quickly blows up when two consecutive render passes use different settings, one targeting the primary while the other the secondary command buffer. Instead of further complicating the logic, just reset the relevant state in every begin(Compute)Pass. Comes with an autotest that is crafted so that it manages to downright crash when run with Vulkan without the fix to the backend. Fixes: QTBUG-89765 Change-Id: I8dc47bd179c17d45a0556ec31200dc90c4b67ca5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 0dbed05bbc16c37483bea90b3eff3db899a0bf07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix flaky test timing out sometimes while waiting for dataDimitrios Apostolou2021-09-171-4/+7
| | | | | | | | | | | | | | | The test used to hang on waitForRead(), sometimes, which underneath involve a poll()+read() syscall pair. When this happened, the IMAP data came together with the proxy data on a previous poll()+read() call and the proxy code had already consumed it. We now wait for data only if data is not already available. Fixes: QTBUG-96345 Change-Id: I084f5d1268a5091ea614fcec91c8d356dcb90d9f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit c7e0a1a966c143485eb32211aaabf62cd8dbf6ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: Allow testing renderpass compatibility without the objectsLaszlo Agocs2021-09-171-0/+11
| | | | | | | | | | | | | | | | | | | | Follow what has been done for QRhiShaderResourceBindings. Have a way to retrieve an opaque blob (that just happens to be a list of integers) so that a simple == comparison can be used to determine compatibility even when the objects from which the blob was retrieved are no longer alive. The contract is the following: bool a = rp1->isCompatible(rp2); bool b = rp1->serializedFormat() == rp2->serializedFormat(); assert(a == b); Change-Id: I45e7d05eeb6dfa2b2de474da0a0644912aaf174a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 43a42fa19693d8ee1a52a5723aa026ee1ccd5de2) Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Support QNX QCC compilerPasi Petäjäjärvi2021-09-171-2/+2
| | | | | | | | | | | | tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o: in function `tst_Moc::os9Newline()': qtbase/tests/auto/tools/moc/tst_moc.cpp:1225: undefined reference to `Os9Newlines::staticMetaObject' tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o: in function `tst_Moc::winNewline()': qtbase/tests/auto/tools/moc/tst_moc.cpp:1239: undefined reference to `WinNewlines::staticMetaObject' Change-Id: I629d67c1190e09b26dc09e41cb7170cb0eadf1cb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5f3e8dde958d2c218b90884d4a368fe9860a41b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Teach QLocale::system() to use narrow formatIvan Solovev2021-09-161-0/+27
| | | | | | | | | | | | | | | | | QLocale::system() was not making use of QLocaleFormat::Narrow, always treating it in the same way as QLocaleFormat::Short. This patch fixes the issue for day and month names. The implementation falls back to CLDR if system locale fails to provide some data. Task-number: QTBUG-84877 Change-Id: Ia37e59dbf02d7a5e230f2767d294b9ab7de37f33 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 61343b5a3f10f5b9166729176d4b95a4c538c278) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't let windowstates manual test eat log messagesTor Arne Vestbø2021-09-151-10/+6
| | | | | | | | | | | | | Having logging in the test's log widget is nice, but we don't want to silence the normal logging, as that might confuse someone who expects to see normal log messages, not knowing there's a dedicated log widget in the test. Change-Id: I7828f740cfb8cc2eae8da98b9b8facd4a57fa37b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5c880e30c79ce7aa6af04c8769eb93389e3dcc62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QThreadPool: Fix restarting of expired threadsIevgenii Meshcheriakov2021-09-151-0/+25
| | | | | | | | | | | | | | | | | Ensure that expired threads have actually finished before attempting to restart them. Calling start() on a thread that is not yet finished does nothing. Add a regression test into tst_qthreadpool that attempts to trigger reuse of expired threads and verifies that all submitted tasks execute. Fixes: QTBUG-72872 Change-Id: I2109b628b8a4e91491115dc56aebf3eb249646b5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 1afd562b0b0bbba02575aa79601f0fae555cfa19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move locale-switching code in test to a shared headerEdward Welbourne2021-09-152-56/+115
| | | | | | | | | | | | | | | | | | | | | | | [On dev, this is also used by QString, which originally motivated the move; but improvements made in the move are worth including in 6.2, and moving to the shared header is the least disruptive way to adapt the cherry-pick, even though tst_qstring.cpp needs no change now.] In the process, I noticed that setlocale() only returns the prior value when passed nullptr as the new value; so rework the implementation to get that right, so that it now correctly restores the prior locale. That, in turn, means there's now a later call to setlocale(), when we actually set the changed setting, which may invalidate the earlier return; so copy it to a QByteArray before the second call. Included Ivan Solovev's improved version of how to reset the locale, since TransientLocale needs it. Change-Id: I4cb1efbda42f0e2cdd934e04b3b3732ce0f45a06 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 458d53f5723314b946d0b401bf91e417131263e9)
* Fix Catch2 compiling for INTEGRITYTatiana Borisova2021-09-142-1/+32
| | | | | | | | | | | - Exclude Green Hills compiler from Catch2's POSIX signal handling. GHS, at least on INTEGRITY, doesn't support full POSIX signals. Task-number: QTBUG-96176 Change-Id: Ifec06dca43ed766cb7335e40fc357d0d7bc463a6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 4f2a515f12e18e932de563ee2a5d7a10ae09487e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPlugin/QFactoryLoader: remove Qt 5 plugin remnantsThiago Macieira2021-09-141-37/+0
| | | | | | | | | | | | Qt 6.x does not need to be able to read the old Qt 5-based binary JSON metadata. The QT_WARNING_DISABLE_DEPRECATED was needed in 5.15 while we used the then-deprecated functions to decode. Change-Id: I2de1b4dfacd443148279fffd16a39ee074da3ef4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit a7fa677fc2db7ec02ab12580b8839d98be6e47bd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix querying font aliases that share name with other fontsEskil Abrahamsen Blomfeldt2021-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a332f3fabc29f796526202648eddf35a24f1cb67 disabled resolving all fonts on the system for every font lookup, which was a significant startup time improvement. But it also caused a regression: When a font has an alias which shares the name of a proper font, then this would not be resolved correctly. This is fairly typical on Windows/GDI due to backwards-compatibility. Instead of being collected under a shared typographical family, fonts are disambiguated by adding the style name to the family name. The proper typographical name is still available, but this is not enumerated by the system. So "Segoe UI" for instance, will be available as "Segoe UI", "Segoe UI Light", "Segoe UI Bold" etc. When we populate family aliases, we register that "Segoe UI Light" is actually "Segoe UI" with Light weight, and prior to a332f3fabc29f796526202648eddf35a24f1cb67 this would be done implicitly. But after the optimization, we would only populate family aliases once we stumbled over a font request for a non-existent font. For "Segoe UI", we would simply return the regular weight font as the best imperfect match. The fix is to populate font family aliases not only when the family is non-existent, but when the match is imperfect, e.g. if we are asking for a Light weight font and only finding a regular one. User code can still avoid this somewhat expensive operation by using the full family names on Windows. This also requires a fix to a test. When removeApplicationFont() is called, we invalidate the font database, so it will be reset to a state that does not contain the family aliases. Therefore we cannot guarantee that it is identical to what it was before the test started, since this depends on what has happened previously in the application. [ChangeLog][QtGui][Text] Fixed an issue where some font styles and weights would not be selectable. This was especially noticeable on Windows. Fixes: QTBUG-94835 Change-Id: I892855edd1c8e3d3734aace396f6000d897d2ec4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e0ad2cee55193696285cc84bf5c4922bb7247e9a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip tst_QReadWriteLock::multipleReadersLoop on QEMUSona Kurazyan2021-09-102-0/+6
| | | | | | | | | | | The test is randomly failing in the CI on QEMU. Couldn't reproduce it on the actual armv7 hardware, so most likely it's not a Qt bug. Fixes: QTBUG-96103 Change-Id: I60b7264c6ce44b3b327fdd0dbcede006717c65a6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit ba8d1da4a971a6351318e86fc613f74843bb2c49) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_http2: Fix flaky authentication testMårten Nordheim2021-09-101-0/+5
| | | | | | | | | | | | The h2 server is running in a separate thread, so while the previous test was finished and the server was deleted, it could still emit and have a queued emission in-flight which would be picked up by the next running test. Change-Id: I26b1bc711df7473032d6078f35f8aca37c40137e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c942bae4ebf903a60a8bd3da9500f7733c71b04d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>