summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2Alex Trotsenko2021-03-022-20/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a foreign event loop that does not enter an alertable wait state is running (which is also the case when a native dialog window is modal), pipe handlers would freeze temporarily due to their APC callbacks not being invoked. We address this problem by moving the I/O callbacks to the Windows thread pool, and only posting completion events to the main loop from there. That makes the actual I/O completely independent from any main loop, while the signal delivery works also with foreign loops (because Qt event delivery uses Windows messages, which foreign loops typically handle correctly). As a nice side effect, performance (and in particular scalability) is improved. Several other approaches have been tried: 1) Using QWinEventNotifier was about a quarter slower and scaled much worse. Additionally, it also required a rather egregious hack to handle the (pathological) case of a single thread talking to both ends of a QLocalSocket synchronously. 2) Queuing APCs from the thread pool to the main thread and also posting wake-up events to its event loop, and handling I/O on the main thread; this performed roughly like this solution, but scaled half as well, and the separate wake-up path was still deemed hacky. 3) Only posting wake-up events to the main thread from the thread pool, and still handling I/O on the main thread; this still performed comparably to 2), and the pathological case was not handled at all. 4) Using this approach for reads and that of 3) for writes was slightly faster with big amounts of data, but scaled slightly worse, and the diverging implementations were deemed not desirable. Fixes: QTBUG-64443 Change-Id: I66443c3021d6ba98639a214c3e768be97d2cf14b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* High-DPI: Set the minimum scale factor to 1Morten Johan Sørvig2021-03-021-0/+15
| | | | | | | | | | | | | | | Avoid painting errors with dpr < 1, also for the PassThrough mode. This limits the minimum high-dpi scale factor to 1, for the code path which determines the scale factor based on screen DPI. Pick-to: 6.1 Task-number: QTBUG-89948 Change-Id: I14b3f130f0ae141d5f05c87437f926a9f76d1dec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Stabilize test QMenu::QTBUG_89082_actionTipsHide() on WindowsFriedemann Kleint2021-03-021-0/+3
| | | | | | | | | | | Move the cursor out of the way to prevent it from interfering. Amends 3f3d5e6716d9130776b3613ccbd5595de7d4af8d. Task-number: QTBUG-89082 Pick-to: 5.15 Pick-to: 6.0 Change-Id: I0efbe2b5618a04e92839083a1bd3383e05d6ff93 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QCommandLineParser: fix crash if there's no QCoreApplicationDavid Faure2021-03-011-0/+29
| | | | | | | | It'll display <executable_name> instead in the help output. Fixes: QTBUG-91430 Change-Id: Ib6211b24cdaa4683a4f62c90b5a1a20ba69f1cff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaType: Store QMetaObject for pointer to const QObject, tooFabian Kosmale2021-02-263-0/+50
| | | | | | | | | | | | | | | | | Before this change, the QMetaType for T const* where T is derived from QObject would not store the static QMetaObject of T. This commit changes this. As a consequence, the metatype system can now convert between const and non-const pointers to QObject. Note that this allows casting const away; but so does C++ with const_cast. In addition, a new flag, QMetaType::IsImmutable is introduced, and used to tag the metatypes of pointer to const types. This allows code to discern between pointers to mutable and const QObjects, which is relevant for the QML engine. Task-number: QTBUG-82354 Change-Id: I3e4e4f39f565bd99a65e161528ce5304df73d6d6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add more support for structured bindingsGiuseppe D'Angelo2021-02-253-0/+115
| | | | | | | | | | | | | | | | | | | | | | | After QPoint(F), it's now the time of QSize(F) and QVectorND, which can be unambiguously decomposed. [ChangeLog][QtCore][QSize] QSize is now usable in a structured binding declaration. [ChangeLog][QtCore][QSizeF] QSizeF is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector2D] QVector2D is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector3D] QVector3D is now usable in a structured binding declaration. [ChangeLog][QtGui][QVector4D] QVector4D is now usable in a structured binding declaration. Change-Id: I67bb152f4210f2be27607179cd2ec522174cc483 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QFuture::continuationsWithContext: fix the flakinessSona Kurazyan2021-02-251-3/+14
| | | | | | | | | | | | | | | | | When attaching a continuation with the default (QtFuture::Launch::Sync) policy, it will be launched in the same thread where the parent has been executing, or in the thread where the parent lives, if the continuation is attached after the parent has already finished. Fixed the test-case to make sure the continuations are attached while the parent is still running, so that they can be resolved in the parent's context. Fixes: QTBUG-91373 Pick-to: 6.1 Change-Id: I82b3b0c47b76d121b44bd512659c08b3b474e351 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* 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. Pick-to: 6.1 6.0 5.15 Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix transitionEachZone() failures on AndroidEdward Welbourne2021-02-242-175/+20
| | | | | | | | | | | | | | | | | | | In QTimeZonePrivate::dataForLocalTime(), mistrust the Android backend's hasDaylightTime(), as it has a comment saying it only knows about future transitions, not past. This caller of it really needs to query "has ever had a transition", which this doesn't answer. Many zones that have no plans for future transitions have had transitions in the past; these were failing the transitionEachZone() test. In the process, refine the test itself, making sure we catch some quirk cases that shouldn't arise and making the debug message on failure more informative (while eliding the zone name, as this is part of the test name anyway, so added to the output by qDebug() itself). Fixes: QTBUG-69131 Change-Id: I88a0528182c247acb8b6327b40516178e455bcc0 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move build tools to libexec instead of the bin dirJoerg Bornemann2021-02-235-5/+6
| | | | | | | | | | | | | | [ChangeLog][Build System] Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. This is a step towards easier co-installability of different Qt versions. Pick-to: 6.1 Task-number: QTBUG-88791 Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Verify that QFileIconProvider returns valid pixmapsMorten Johan Sørvig2021-02-231-6/+6
| | | | | | | | | Extend and rename the pixmap() crash test to also verify that a non-null pixmap is returned. Change-Id: Ia972c4f705724cfa1394521a2dfd87451d9c5d64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix some warnings about virtual/overrideAndreas Buhr2021-02-232-3/+3
| | | | | | | | | This patch marks some functions "override" to silence the corresponding warning. Change-Id: I88ccc5fa7521ecccc84a6cba9f06ea185cc5679e Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QProcess/Unix: remove outdated notices about use of posix_spawn() on QNXThiago Macieira2021-02-211-3/+0
| | | | | | | | | We haven't used the spawn functionality on QNX since Qt 5.7 (commit 005a8bfbf0022f03dafafcf2b5c438ccf0675a49) because that's when we dropped support for QNX 6.5.0. Change-Id: Ic90d8429a0eb4837971dfffd1664f9712bdce2d8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached/Unix: report which function failedThiago Macieira2021-02-211-0/+4
| | | | | | | | Like QProcess::start(). Pick-to: 6.1 Change-Id: Ic90d8429a0eb4837971dfffd1664ef1293a6523d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QProcess::startDetached: set the error condition on failure to startThiago Macieira2021-02-211-0/+2
| | | | | | | | | | | | And set *pid to -1. [ChangeLog][QtCore][QProcess] If a startDetached() fails to start the target application, the QProcess object should now have a proper error string in errorString(). Pick-to: 6.1 Change-Id: Ic90d8429a0eb4837971dfffd1664e825ffcb923e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Port QSslKey to the new plugin-based implementationTimur Pocheptsov2021-02-191-24/+24
| | | | | | | | | | | | | The idea is to have QSslKey(Private) backend-neutral and hide all library-specific code inside plugins. Fixes: QTBUG-90953 Task-number: QTBUG-65922 Change-Id: I2eeee3b2b72c78c2e24f2fb914abce3caa913be8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 0352cf8e1bf57615b9faf3f6f383896444e762ac) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QProcess::startDetached/Unix: move up the chdir() and remove qWarningThiago Macieira2021-02-181-0/+15
| | | | | | | | | | That qWarning cannot be in the child process (we don't know if a user logger is fork-no-exec-safe) and the failure to chdir() should be reported as a failure in QProcess::startDetached() instead. Change-Id: Ic90d8429a0eb4837971dfffd1664e7577c81610b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
* QJsonObject: Fix operator<=()Ulf Hermann2021-02-181-0/+31
| | | | | | | | | | We had a copy-paste error there. Pick-to: 6.0 6.1 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>
* Fix warning about unused variableAndreas Buhr2021-02-181-0/+1
| | | | | | | | I get a warning about the variable t_var being set but not used. This patch fixes the warning. Change-Id: Ib2df5ed2dddd283eb87f71a8b85951d1f67f04f2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Return early after test-helpers if they failEdward Welbourne2021-02-181-0/+10
| | | | | | | | | | | The QTimeZone tests have some helper functions to test details of a QTZP instance; these use QCOMPARE(), so may return early on failure. The callers then need to notice the failure and, in their turn, also return. Change-Id: I0a188e9641ced70c9ffedd95e91f39681fad768a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Skip a timezone transition test on AndroidEdward Welbourne2021-02-182-3/+5
| | | | | | | | | | | | Its back-end lacks transition data, so the test can't possibly succeed. Make the skip conditional on the tested zone having transitions, so that the test will come back into play if we ever gain support for transitions on Android. Fixes: QTBUG-69129 Change-Id: Ie4f96601b8b18cd496efbde7cf2557875cf3c1c9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* tst_qprocess: enable test again for cross-compilationsSamuli Piippo2021-02-163-10/+1
| | | | | | | | | | | | All test cases pass with QEMU. Fixes: QTBUG-85287 Fixes: QTBUG-67760 Pick-to: 6.1 Change-Id: I188d70c05f6d858e17f1099d3c02862ea9b2a2ab Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_qapplication: Prevent desktopaware test from deactivating main testTor Arne Vestbø2021-02-151-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 Pick-to: 6.1 6.0 5.15 Change-Id: If53a86548002b739df0c0a7153d6244924a4a205 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix QTimer::setInterval to remove existing bindingsAndreas Buhr2021-02-151-0/+4
| | | | | | | | | | A recent change ( a7ca8b1a2864e47cacd530f6b10d2b415c5193f7 ) led to failure of binding removal in setInterval(). This was fixed by introducing setterScope. This patch add unit tests for this regression. Change-Id: Ic8da1f2d82ad6c8ccd81c9b1eff72d42cf75f28a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Drop parsing of antique TextDate formatEdward Welbourne2021-02-151-43/+42
| | | | | | | | | | | | | | | | | | | | | | Apparently we used to have (back in 2007, only on Windows, incompatibly with what we were then using on Unix) a TextDate format (only for QDateTime, QDate used what it still uses) that put the day-of-month number, with a dot after it, before the month's short name. We have retained parsing of this format, on all platforms, ever since. It no longer matches the format we now use (since 5.2, in 2013, commit 61b56a89a1cf8a388ff925492700e5eef019c3aa, which harmonised the format with Unix and QDate); now seems like a good time to stop complicating our parser for its sake. [ChangeLog][QtCore][QDateTime] The parsing of Qt::TextDate in QDateTime::fromString() no longer supports the old TextDate format used (only) on Windows by Qt < 5.2 ("ddd d. MMM yyyy" with an "HH:mm:ss" time either appended or inserted before "yyyy"). Change-Id: I73a798ab78f187543e415119cc4a11f1cfd73820 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime::toString(): use UTC-offset as time-zone suffixEdward Welbourne2021-02-151-13/+2
| | | | | | | | | | | | | | | | | | | Since fromString() can't parse the (ambiguous at the best of times; also backend-dependent and thus potentially system-locale-dependent) abbreviations currently produced (since 5.9) and can parse UTC-based offsets, the OffsetName of the zone is a more robust format for the zone-suffix. This also makes it possible to consistently use the C locale, compatibly with everything else about post-6.0 date-time serialization. [ChangeLog][QtCore][QDateTime] When spec is Qt::TimeZone, the offset-suffix now used for the toString(Qt::TextDate) format is now a UTC-based offset string, compatible with the parsing (now) supported by fromString(). The zone-abbreviation suffix in use since 5.9 was not parseable. Change-Id: I4024ae87980c6d3590c68a67b8d1c8f433e36855 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prepare TextDate to use UTC-offset rather than GMT-offset zone suffixesEdward Welbourne2021-02-151-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are GMT-offset zones whose convention for the sign of the offset is the reverse of what we are (still) using, which is the usual convention for UTC-offset zone: for example, the Olson Database's Etc/GMT+3 has offset -3 hours in the UTC-based system we use, so we give it suffix GMT-0300. The UTC-based suffix is also what we use as the abbreviation for OffsetFromUTC() in toString(). For now this only adds support for parsing a planned future form: the old form using GMT is retained, to give client code some chance to prepare for a backwards-compatible transition. Although the GMT prefix is matched case-insensitively, only match UTC if fully upper-case; there is no meaningful precedent for case-insensitive usage here. [ChangeLog][QtCore][QDateTime] The Qt::TextDate format now recognizes UTC-based offset suffixes in addition to suffixes based on the deprecated alias GMT. This prepares for toString() to use such UTC-based suffixes for time-zones (fromString() cannot parse the present abbreviation suffix). A future release of Qt shall use UTC-based suffixes in place of the present GMT-based suffixes (which conflict with GMT-based IANA zone names) for Qt::LocalTime and Qt::OffsetFromUTC time-specs. Client code is encouraged to use and recognize UTC-based zone suffixes in preparation for that transition, unless compatibility with versions before 6.2 is required. Change-Id: I5a42a488f1232a30f4b427b7954759283423b9b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extend colorspace testing and fix bug it uncoveredAllan Sandfeld Jensen2021-02-131-0/+119
| | | | | | | | | | When changing transferfunction the look-up-tables needs to be regenerated. Pick-to: 6.1 6.0 5.15 Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Move QEMU emulation detector to QTestSamuli Piippo2021-02-1324-61/+40
| | | | | | | | | The emulation detection has been usable only on qtbase tests, move it to QTest so that it can be used in other modules as well. Pick-to: 6.1 Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Disable warnings from using deprecated QScopedPointer::takeVolker Hilsheimer2021-02-131-0/+6
| | | | | | | | It's the QScopedPointer test, so we want to test deprecated APIs. Change-Id: I029103b3150c576cba9b395aafc571b9fccc914a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* 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. Pick-to: 6.1 6.0 5.15 Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Rework tst_QDateTime::toString_isoDate() to eliminate an XFAILEdward Welbourne2021-02-121-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 Pick-to: 6.1 6.0 5.15 Change-Id: I680aa31ee0dcc8fadabb5d4cd6c083a8afd48573 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systemsEdward Welbourne2021-02-121-18/+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 Pick-to: 6.1 6.0 5.15 Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QScopedPointer with std::unique_ptrVolker Hilsheimer2021-02-121-7/+7
| | | | | | | | Fix compile warning from QScopedPointer::take being deprecated. Change-Id: I7f86e08a5a1021263ee57898cbc1d5942ea3113b Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warning: don't mix signed and unsigned int in comparisonVolker Hilsheimer2021-02-111-1/+1
| | | | | Change-Id: Ib6609d70900a0c26dd88bbfd16e886773ae67420 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix registerNativeMethods for goodAssam Boudjelthia2021-02-113-0/+79
| | | | | | | | | | | | | | | | | The initial implementation and the commit c00ab6f8eaa3cdc9a29dd103c91b2eaf212cac9f was wrong: * env->findClass() in fact returns a global reference, and in any case we shouldn't be calling that, instead QJniObject would be enough. * The size param provided to env->RegisterNatives was wrong. * A test for registerNativeMethods() is added to ensure such break is not repeated again. Task-number: QTBUG-89633 Pick-to: 6.1 Change-Id: I4d3a6a9270755f465c40add25521fb750dd4de0a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* macOS: Be honest about the system localeTor Arne Vestbø2021-02-111-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system locale of a macOS application is not affected by environment variables like LANG. Yet, we were reporting a name determined from environment variables as the fallbackUiLocale(), rather than one based on the language and country of the actual system locale. This lead, via the usual CLDR likely-subtag fallback, to claiming the system locale's name, language, script and country were those obtained from these environment variables, even when they were at odds with the actual locale being used by the system, which was being used for some queries. Worse yet, any data not supplied by these queries was being obtained from the same CLDR locale as the name, making for an inconsistent mix of locale data. While we cannot avoid the likely-subtag fallback step for fallback data, it is more consistent to use the actual system locale's name as start-point for that fallback. At the same time, add support for the language, script and country queries, so that the QLocale::system() describes itself faithfully, instead of claiming to be the locale that results from that fallback. If we want to support LANG or other environment variable overrides, they should be handled by the layer above the system locale, by changing the default locale of the Qt application, as if the user had called QLocale::setDefault(). [ChangeLog][QtCore][QLocale] QLocale::system() on macOS no longer pretends to support LANG or other environment variables as overrides, as this is not a feature that the system locale on macOS supports. To override the locale of an application, use QLocale::setDefault(), or pass -AppleLocale en_US. Fixes: QTBUG-90971 Change-Id: Ibdaf5ff9a2050f61233a88eabf3c29094f7757f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QDate's text round-trip test do actual comparisonsEdward Welbourne2021-02-111-5/+7
| | | | | | | | Previously the only test was that it produced no warnings, if anyone paused to read the output to notice them. Change-Id: I225ca99c7ec316186702c0fdb355585374c014a4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix recently added auto test of text layout overflowEirik Aavitsland2021-02-101-1/+2
| | | | | | | | | Ignore width of trailing space. Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-91038 Change-Id: I74e278366a2c3b170335738bf6d6ee23933b361a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Restore pre-Qt6 QList::fill() behaviorAndrei Golubev2021-02-101-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 Pick-to: 6.0 6.1 Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Split up the QMetaType unit testVolker Hilsheimer2021-02-097-915/+969
| | | | | | | | | | | gcc 9 consumed enourmous amounts of memory building the test, regularly dying on a VM with 4GB RAM. Splitting it up helps. As a drive-by, use inline static variables, and rename the header used by other tests to tst_qmetatype_common.h. Change-Id: Ib716d8e3506aac6c87845e57b04cb1a4f6c68387 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTextureFileData: support key value metadataJonas Karlsson2021-02-094-0/+19
| | | | | | | Task-Id: QTBUG-76970 Pick-to: 6.1 Change-Id: I9dba1b373250cea4d0c806997290a7afcdc900d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Clarify what QSystemLocale::fallbackLocale() is used forTor Arne Vestbø2021-02-091-1/+1
| | | | | Change-Id: I8f073f996505ccb42020b32fd76520ecef54e628 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* 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 Pick-to: 5.15 6.0 6.1 Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Blacklist tst_macgui::scrollBarPainting()Tor Arne Vestbø2021-02-081-0/+3
| | | | | | | | | It fails on 10.15 and 11, preventing those from being significant, and the test is already marked as expect-fail based on QTBUG-20984. Task-number: QTBUG-20984 Change-Id: I6911166a1c3e9173d6d36f2a3a68b37778fd3406 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* 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. Pick-to: 6.1 6.0 Fixes: QTBUG-90698 Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tst_qtexttable: fix fail on QEMU ARMv7Samuli Piippo2021-02-051-1/+1
| | | | | | | | | | | Different font was used when running on QEMU ARMv7 and the second page was never reached. Pick-to: 6.1 Task-number: QTQAINFRA-4127 Change-Id: Ic85b76661cf3642b69e6e1b21e8062d7c36231e3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix flakiness in tst_QGlyphRun::drawRightToLeftEskil Abrahamsen Blomfeldt2021-02-042-6/+0
| | | | | | | | | | | | | | | | As described in 3279c8e7d72c5eee379fa8e4a2789acfe40445c0, we can't depend on the widths of decoration to always be the same for drawText() and equivalent drawStaticText/drawGlyphRun. This is typically visible as an off-by-one when using the default fonts on OpenSUSE. Since this test was actually made to test positions of RTL glyphs, we can just disable the decoration and simplify the text. Fixes: QTBUG-89086 Change-Id: I139fe3e1c5e98d8b1d7e0e7c19645fd4717d1d95 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* a11y: Report mixed state if QCheckBox is PartiallyCheckedJan Arve Sæther2021-02-043-3/+7
| | | | | | | | | | Previously it only returned checked or unchecked for a tri-state checkbox. Fixes: QTBUG-84616 Pick-to: 5.15 6.0 6.1 Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qdatetime: remove blacklisting and expect failureSamuli Piippo2021-02-042-4/+4
| | | | | | | | | Amend ac970d48fdd35b03686d4c77d955875d6e8b1d68 and use QEXPECT_FAILURE for systemTimeZone test on 32bit systems. Task-number: QTBUG-89889 Change-Id: I0eed35df871c69a20bcd7c544fc0e9a48dd8db7b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>