summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove qmake project files for benchmarksJoerg Bornemann2021-02-01144-1058/+0
| | | | | | | | Also remove tests/tests.pro that would be empty without the benchmarks. Change-Id: Iaf92a729d1286b3e0c03bf9f877b59e1d83708e6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Support cubemap ktx filesJonas Karlsson2021-02-014-0/+22
| | | | | | Change-Id: I6905c393647d31fab958cdd9471bb0a6ffe83596 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* 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 Pick-to: 6.0 5.15 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>
* Remove QObjectCompatProperty::operator= for safer usageAndreas Buhr2021-01-291-11/+11
| | | | | | | | | | | | | Introduction of QObjectCompatProperty requires every write to the property to be examined whether it is OK or should be replaced by a setValueBypassingBindings/markDirty combination. The existence of operator= make this difficult as it is easy to miss places where it is written. By not having operator=, we can help developers make sure they had a conscious decision about each write to the property. Change-Id: Ia61ea4722eb0bab26ce7684b85dd03d710cd1751 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "Port QThreadPool to the new property system"Allan Sandfeld Jensen2021-01-291-78/+14
| | | | | | | | | | This reverts commit 8f8405e04642b98663d4752d4ae76c304ae33b01. Reason for revert: Appears not entirely thread-safe and caused QTBUG-90705 Change-Id: I390c0b1a555a18e6a095b52010371d017071e26b Fixes: QTBUG-90705 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Import qproperty benchmarks from private repoMaximilian Goldstein2021-01-294-0/+323
| | | | | Change-Id: Icff5685b921f8a99acfeda1d79bb03ee652aa107 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QProperty: Treat change listener modifying its source property as a loopFabian Kosmale2021-01-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in line with QML where import QtQuick 2.15 Rectangle { width: 100 height: 100 color: "red" Rectangle { id: inner x: 10 y: x width: 50 height: 50 onYChanged: { console.log("hey"); inner.x = 10} TapHandler { onTapped: inner.x = 20 } } } results in a binding loop warning when the tap handler triggers. While the change handler would only run once, we cannot statically determine if we need to loop once, twice, or if there actually is a diverging loop. Thus we unconditionally warn about the binding loop and stop executing the binding. As a drive-by, verify in the related test that a change handler which overwrites its properties binding itself removes the binding. Change-Id: I5372019c2389ab724c49cd7489ecbd3ebced1c69 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* TLS backend: merge with its factoryTimur Pocheptsov2021-01-281-87/+79
| | | | | | | | | | | | | | QTlsBackend is a factory itself - it creates TLS/X509 objects. Having an intermediary between Factory->Backend->TLS primitive does not look very natural thus let's squash the first two parts. Backend is a factory creating TLS primitives, but its static functions also provide information about backends availablei and give access to those backends. Fixes: QTBUG-90606 Task-number: QTBUG-65922 Change-Id: I8409d81fd11fb46e6ab4465b4937a7680a8c2447 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Avoid overflow in text layoutEirik Aavitsland2021-01-281-0/+13
| | | | | | | | | Fixes oss-fuzz issue 29313. Pick-to: 6.0 5.15 Change-Id: Idbabd162fa9e0dbce687981bdbcc75be37189a61 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* Remove blacklisting for b2qt tests that now passSamuli Piippo2021-01-283-5/+0
| | | | | | | With the updated QEMU and toolchain, these tests now pass. Change-Id: Icb74562a0e6422cd4564f63db991aa431e0e3119 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* tests: remove unnecessary skips for qemuSamuli Piippo2021-01-284-23/+0
| | | | | | | QEMU sysroots are now root owned. Change-Id: Id829cb5debc449efee929ef83876e6ffbf78332c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Port QLocalServer to the new property systemTimur Pocheptsov2021-01-271-0/+16
| | | | | | Task-number: QTBUG-85520 Change-Id: Iee43a2e9e2d4847dad3b8be345d562af9aa3b690 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QDnsLookup - port to the new property systemTimur Pocheptsov2021-01-271-0/+49
| | | | | | | | | Read/write/notify properties, 3 out of 5 defined in this class. Task-number: QTBUG-85520 Change-Id: Ic6c74f90a2fa3c71d71cf9a5d557f1b6fc489d35 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-276-0/+1365
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Port QMovie to the new property systemSona Kurazyan2021-01-271-0/+33
| | | | | | | | Task-number: QTBUG-85520 Task-number: QTBUG-85521 Change-Id: Ib936020260cf01a5221b63fb1eb0ccb23f5553a3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Q(Untyped)Bindable: add takeBinding methodFabian Kosmale2021-01-271-0/+18
| | | | | | | | | | | We missed takeBinding as a supported operation on Q(Untyped)Bindable. To avoid adding version checks to code dealing with QBindableInterface, we simply synthesize takeBinding as a combination of binding to retrieve the binding and setBinding with a default-constructed QUntypedPropertyBinding. Change-Id: I43803a0dfe210353d0235f0373d2257f75ffe534 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* 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 Pick-to: 5.15 Pick-to: 6.0 Change-Id: Ie1bc4157e6d0e807d8530f70dcbd27b5e2fc813c Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Add qHypot() to qmath.h, exposing and extending std::hypot()Edward Welbourne2021-01-271-2/+77
| | | | | | | | | | | | | | | | | | | | We have plenty of places where we add some squares and take a square root; this may be done more accurately and faster by hypot(). Introduce QHypotHelper to handle hypot with more than 3 parameters, and with 3 when the C++17 version is missing (which it never should be). Include an overload taking arbitrarily many valus and ensure that we can use qHypot() with qfloat16. Illustrate with some example uses, add some tests. [ChangeLog][QtCore][QMath] Header <QMath> now provides qHypot(), an implementation of std::hypot() taking arbitrarily many numeric values, including support for qfloat16, while avoiding the overflow and underflow problems that arise when naively taking the square root of a sum of squares. Change-Id: Ia4e3913fe83fc27d17d8e7f1a52f03ad445c1fed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update public suffix list to today's latestEdward Welbourne2021-01-271-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 Pick-to: 6.0 5.15 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>
* Port QThreadPool to the new property systemSona Kurazyan2021-01-271-14/+78
| | | | | | | | | | | Ported all properties, except activeThreadCount. Marking it dirty may cause a re-evaluation of properties depending on it, which may reault in a deadlock in case of trying to read activeThreadCount property which is being marked as dirty. Task-number: QTBUG-85520 Change-Id: Id073b0895c89a9e6b05b57ad520db994e550a1c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QVariant benchmark: fix crashesFabian Kosmale2021-01-271-4/+7
| | | | | | | | | | - Skip unused metatype id - Do not construct a QVariant from an int, when we instead want to construct a QVariant for a given metatype (was: metatype id in Qt 5) Pick-to: 6.0 Change-Id: I1ac19dec5549b424a9429f69999eaf8e96c022e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QJsonObject::take: add missing detach() callThiago Macieira2021-01-271-0/+19
| | | | | | | | | | We were modifying shared objects. Pick-to: 6.0 5.15 Fixes: QTBUG-89625 Change-Id: Id6bc735b79cf4beb9454fffd165c56476a5dec04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Port QStandardItemModel to the new property systemSona Kurazyan2021-01-261-0/+17
| | | | | | | | Task-number: QTBUG-85520 Task-number: QTBUG-85521 Change-Id: I2f9bbe8bc06838fcbadd446e111fb697120f550c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTimer: port to new property systemIvan Solovev2021-01-261-0/+88
| | | | | | | | Task-number: QTBUG-85520 Change-Id: I1f92b86619f2ca186c505251b21463f396af0ac6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Port QPauseAnimation to the new property systemSona Kurazyan2021-01-261-0/+41
| | | | | | | Task-number: QTBUG-85520 Change-Id: I8c0ee86598f4c0f093f64b2891ee835a43964b84 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QRegularExpression: add move constructorIvan Solovev2021-01-261-0/+115
| | | | | | | | | | | | - Add move constructors to QRegularExpression, QRegularExpressionMatch and QRegularExpressionMatchIterator. - Update the documentation to explicitly state that only destructor and assignment operators can be called for a moved-from object Task-number: QTBUG-86634 Change-Id: I06b4f54e300541033a9a18339c97338717a06da0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QIcon: Use the @nx pixmaps in the paint methodBastien Bouclet2021-01-261-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. Pick-to: 6.0 Fixes: QTBUG-90042 Change-Id: I53995a2285ef879e3c4fddb9f8da702e256a260f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* 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 Pick-to: 6.0 Change-Id: I8176a4cc79f100ee772b09425e88fe8ff3ae226a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QLocale: Allow direct conversion from language, country, and script codesKai Köhne2021-01-251-0/+27
| | | | | | | | | | | | | | | This complements patch a148c7b5d71d244, where languageToCode(), countryToCode() scriptToCode() methods were introduced, with matching codeToLanguage(), codeToCountry(), and codeToScript() methods. This allows us to remove the use of private Qt Core API in Qt Linguist. [ChangeLog][QtCore][QLocale] Added static codeToLanguage(), codeToCountry(), codeToScript() methods that convert ISO code strings to the respective enum values. Change-Id: If5c0843a718c006ade086a6f74ceb86ac6e0fce4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* dbus: Fix missing QVersionNumber includeKevin Funk2021-01-251-0/+1
| | | | | | | | Fixes the build Change-Id: Ie0b7a1476bb1f80ee2ccfe1cbc6ca37e9c93e758 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the QT_CMAKE_BUILD preprocessor defineJoerg Bornemann2021-01-222-6/+0
| | | | | | | | | | | | Qt is now always built with CMake. The "cmake" keyword for QtTest blacklists remains for now. Removal is tracked in QTBUG-90545. Change-Id: I0011d56176a07c82698b2eb9aa330e77efa6cd34 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* High-DPI: Test application startup with no screensMorten Johan Sørvig2021-01-221-0/+16
| | | | | | | | | | | | | Initialize the offscreen platform plugin with no screens, create QGuiApplication object. Not much of the high-dpi related Qt API can be used in this configuration, but at least Qt should not crash on startup. Task-number: QTBUG-71034 Change-Id: I6620843c3bd8b692c5c2419b1ba290e16175ba5b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* rhi: Pipeline cache load/saveLaszlo Agocs2021-01-222-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add QRhi APIs to retrieve and reload the contents of the "pipeline cache". The only API where there is a true pipeline cache is object is Vulkan (VkPipelineCache). For OpenGL, the other backend where we support this, it is simulated with program binaries. The Qt 5 style OpenGL program binary disk cache continues to work like before, but one has now the option to do things in a more modern, graphics API agnostic way, that leads to generating a single blob instead of a large set of files in some system location, allowing easier "pre-baking" of the cache content. It is expected that Qt Quick exposes the two new functions in form if QSG_RHI_ environment variables, thus allowing easy testing and cache file generation. As an example for the performance improvements this can give, consider Vulkan, where we do not have any existing persistent caching mechanism in place: Running BenchmarkDemoQt6.exe --scene flythrough --mode demo creates 18 QRhiGraphicsPipeline objects from Qt Quick and Qt Quick 3D. The total time spent in QRhiGraphicsPipeline::create() during application startup for these 18 pipelines is 35-40 ms on a given Windows (NVIDIA) system. When exporting the pipeline cache contents to a file, and then, in a subsequent run, reloading the cache contents, this is reduced to 5-7 ms on the same system, meaning we get a 6-7x improvement. The generated data is always specific to a given Qt version, RHI backend, graphics device, and driver version. Much of the implementation consists of adding and verifying the appropriate header to the blobs retrieved from the driver, to allow gracefully ignoring data that was generated with a device or driver that differs from the one used at run time. This should provide robustness, even if the Vulkan or OpenGL implementation is for some reason not prepared to identity and reject incompatible cache/program blobs. Fixes: QTBUG-90398 Change-Id: I67b197f393562434f372c7b7377f638abab85cb3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QSsl: add a new private APITimur Pocheptsov2021-01-221-4/+136
| | | | | | | | | This is an abstraction for TLS backend and its factory, preparing to transition to plugin-based design. Task-number: QTBUG-65922 Change-Id: Ibe810e77fd1b715a6bea66cd3f44312b015ac274 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_qfont: expect failure on font testcase for QEMU ARMv7Samuli Piippo2021-01-222-0/+7
| | | | | | | | FontConfig related tests fail on ARMv7 QEMU. Task-number: QTQAINFRA-4127 Change-Id: I3202f660d12d09a65bc50747d679921b6dfa75f8 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QSslSocket - introduce the API providing information about backendsTimur Pocheptsov2021-01-211-1/+45
| | | | | | | | | | | | | | This API gives the names of available backends and provides a basic information about features/protocols supported by those backends. Also, it has the 'loadBackend' functions which allow to select a particular backend (which are becoming plugins). At the moment, the implementation is still 'hardcoded', the follow-up patch will allow to select different backends in runtime. Task-number: QTBUG-65922 Change-Id: I05877de9c02857594e76b24d52e7578bdb01df69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_qvulkan: Skip assumption about supportedApiVersionLaszlo Agocs2021-01-211-3/+4
| | | | | | | | | | | ...when the platform does not support Vulkan. The version is left at the default 0 then, so checking for >= 1.0 is wrong. This allows the test to pass with the offscreen platform plugin. Change-Id: I5afba8f1e703e4fa0ff41da91d18f5fabfb54868 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QProperty: Add private isAnyBindingEvaluating functionFabian Kosmale2021-01-211-0/+9
| | | | | | | | | | | | | | | | | To optimize certain operations, it can be useful to know whether we are currently evaluating a binding. For instance, we have properties whose storage is only alloctaed on-demand when they are set. However, we would also allocate them if they are used in a binding context, as we would otherwise not properly track the dependency. Using isAnyBindingEvaluating in the getter, we can detect this situation, and avoid the allocation if it returns false. This API is private for now, as it exposes some internals of the property system and should be used with care. As it needs to access the TLS variable, it also has a non-negligible cost. Change-Id: I373aabee644fe7020b2ffba7d6a0ad9a1e1b4ec0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* tst_qsequentialanimationgroup.cpp: Avoid some memory leaksUlf Hermann2021-01-211-5/+14
| | | | | | Change-Id: Iecedb31b6993f6771b4b7a5d2708995365b8515f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tst_socketnotifier: Fix timeout of QTcpServer::waitForNewConnection()Friedemann Kleint2021-01-211-2/+2
| | | | | | | | The timeout defaults to 0, give it 5s. Pick-to: 6.0 Change-Id: I975810a1ecee8bb8b3a3f143f1379a9a09589a40 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
* Add simple benchmark for QRegularExpressionIvan Solovev2021-01-206-1/+321
| | | | | | | | | | | | The benchmark simply calls QRegularExpression's public API methods, so that we can assess how changes to the implication impact performance. (Its addition is prompted by evaluation of whether adding a move constructor saves more or less than the resulting need for d-pointer null-checks costs.) Task-number: QTBUG-86634 Change-Id: Idef775ef6cf9f9ded3ce7ba5b85e460571d12756 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Long live QNetworkInformationMårten Nordheim2021-01-203-0/+163
| | | | | | | | | | | The plugins are meant to indicate what they do support, meaning users of QNetworkInformation can choose to not care about which plugin is used and rather just request what they want. Task-number: QTBUG-86966 Change-Id: Ie130e1791250ec2a4470e3ba7081d982654af06c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove unused variable from QNetworkReply benchmarkVolker Hilsheimer2021-01-191-1/+0
| | | | | | | | Fixes compiler warning. Change-Id: I73963f9f711b02d999b366dbf884acd5c851c950 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_socketnotifier/unexpectedDisconnection: Extend blacklisting to all ↵Friedemann Kleint2021-01-191-2/+2
| | | | | | | | | | windows versions The test has been failing frequently, recently. Pick-to: 6.0 Change-Id: I3ae00a64f67e4b6a0b5ade0c660805f4d12f8317 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* control scrolling of QTabBar using StyleHintSophie Kums2021-01-191-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mouse wheel/touchpad scroll signals sent to the tab bar trigger cycling through the tabs. In applications where the tab bar is close to "mouse click hotspots", the cursor may accidentally be left over the tab bar instead of the main content of the window. When the user wants to scroll up/down the main conten, the scroll signals are thus sent to the tab bar and instead of scrolling, the focus switches to another tab. This is confusing to the user, because not only does the application not carry out the desired action (scrolling through the main content), it jumps to a different tab. Two common examples of applications affected by this nuisance are Konsole and any kind of browser (file browser or web browser), where the address bar is right below the tab bar. Moreover, on macOS, scroll events do not have an effect on the tab bar widget of the native UI. Currently, the code makes use of preprocessor directives to achieve consistent behavior on macOS (`#ifndef Q_OS_MAC`). This patch implements the check of a StyleHint in order to determine if scroll events on the tabbar should have an effect. This approach is more consistent with Qt coding style than OS-dependent preprocessor directives and, in addition, makes the behavior configurable according to the user's preferences. [ChangeLog][QtWidgets][QStyle] Added SH_TabBar_AllowWheelScrolling as a style hint to enable/disable cycling through tabs using the scroll wheel. This defaults to true in all styles except the macOS one so there is no change in existing behavior. Change-Id: I99eeb5a1aab03cbc574fac7187d85a8a2d60cf34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* tst_QThreadPool: avoid a potential memory leaksSona Kurazyan2021-01-191-53/+45
| | | | | | | | | Don't use raw pointers when allocating memory, it won't be deleted if the test-cases fail. Change-Id: I212a12c988f401f97c2c92a7fae09b2aa7d913a9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Fix qt_add_big_resources with namespace buildsAlexey Edelev2021-01-191-2/+1
| | | | | | | | | | | | Add INTERFACE_COMPILE_DEFINITIONS of Qt6::Core to generated rcc object libraries. This propagates QT_NAMESPACE definition to the object library. Fixes: QTBUG-85620 Change-Id: I252d1aaee7b19a49bc321fdd271a5d85a34bf67f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_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. Pick-to: 6.0 Fixes: QTBUG-89398 Change-Id: I119b25682ba18e18466b5687cae369445dc73311 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update QVulkan(Device)Functions to Vulkan 1.2Laszlo Agocs2021-01-191-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also needs improvements to qvkgen. What we get with this patch are the Vulkan 1.1 and 1.2 core API's additional 11 instance-level and 30 device-level commands present in QVulkanFunctions and QVulkanDeviceFunctions. All of these are attempted to be resolved upon construction. When the implementation does not return a valid function pointer for some of them (e.g. because it is a Vulkan 1.0 instance or physical device), calling the corresponding wrapper functions will lead to unspecified behavior. This is in line with how QOpenGLExtraFunctions works. The simple autotest added to exercise some Vulkan 1.1 APIs demonstrates this in action. The member functions in the generated qvulkan(device)functions header and source files are ifdefed by VK_VERSION_1_{0,1,2}. This is essential because otherwise a Qt build made on a system with Vulkan 1.2 headers would cause compilation breaks in application build environments with Vulkan 1.0/1.1 headers when including qvulkanfunctions.h (due to missing the 1.1/1.2 types and constants, some of which are used in the function prototypes). In practice this should be alright - the only caveat to keep in mind is that the Qt builds meant to be distributed to a wide variety of systems need to be made with a sufficiently new version of the Vulkan headers installed, just to ensure that the 1.1 and 1.2 wrapper functions are compiled into the Qt libraries. Task-number: QTBUG-90219 Change-Id: I48360a8a2e915d2709fe82993f65e99b2ccd5d53 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Correct string comparison in Android's IANA ID matching codeEdward Welbourne2021-01-182-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 Pick-to: 6.0 5.15 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>