aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Detach QEventPoint instances during touch compression; test & docsShawn Rutledge2022-02-042-0/+71
| | | | | | | | | | | | | | | | | | | | If we don't detach, they could be modified between the time that the event is stored (delayed) until it's delivered. QQuickDeliveryAgentPrivate::compressTouchEvent() had no explicit test coverage until now; in fact, most tests call QQuickTouchUtils::flush() after every touch event to ensure that it gets delivered immediately. Also add internal docs. Fixes: QTBUG-97185 Fixes: QTBUG-98486 Fixes: QTBUG-98543 Change-Id: I6fd76651ca6fbf15169c44d4d9dbbeb7dc7e3a71 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit d08038ba7015dc681c95654f7fe5e54b60c2e55c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlAdaptorModel: Do not use reparenting for lifetime managemmentFabian Kosmale2022-02-032-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQmlAdaptorModel, we were using QQmlStrongJSQObjectReference to ensure that a passed in model lives long enough. However, QQmlAdaptorModel uses reparenting to keep objects alive. This is not safe, as we can use QML singletons as models. Reparenting singletons messes with the engine's lifetime handling once their new parent gets deleted: The object will be marked as queuedForDeletion by QQmlData::markAsDeleted; consequently wasDeleted returns true for the object, and any ScopedObject or ObjectWrapper will return nullptr when we try to retrieve their underlying QObject. The actual object probaly does not get deleted, as it is not placed in the QML heap. Consequently the gc will ignore it. This leads to a crash when the singleton is accessed in a different place: We see that the object is non-null, create a ScopedObject for it, and then try to later access the ScopedObject's underlying object (assuming that it must be non-null, because we already checked for the actual object being non-null). However, due to the reasons outlined above, we actually receive a null pointer, and thus encounter a crash. To avoid he issue, we change the lifetime management strategy: Instead of using the parent to keep the object alive, we now use a QV4::PersistentValue. Fixes: QTBUG-100260 Change-Id: I266e6ef94c4f079de3da2742d6fb8d61df5a64ce Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 6901eacff40a7d8781e20fb5bcfd28d7526b589b)
* qmltc: Rely on QQmlJSResourceFileMapperAndrei Golubev2022-02-032-8/+19
| | | | | | | | | | | | | | | | | Similarly to qmllint, we should use QQmlJSResourceFileMapper in qmltc. This should in theory allow us to avoid implicit import dir vs qmldir path issues (where the former comes from source dir while the latter comes from build dir) At present, it does not seem to be the case, however. But this is to be addressed separately Task-number: QTBUG-100103 Change-Id: Ie85799cb0a4b8b1620964000bc5939e9d046678e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 8a72c684464a48595337b01ada5605f612f7971e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restructure QML module of qmltc testsAndrei Golubev2022-02-0312-198/+183
| | | | | | | | | | | | | | | | | | | | | | | | Use a more canonical qmlcppcodegen-like structure, showcasing a better QML module As this change makes a single QML module instead of two QML modules (for the _diskcache and _nodiskcache scenarios), there are pros and cons Pros: + Prepares us for proper introduction of QQmlJSResourceFileMapper + Theorically allows tests to avoid (additional) weird imports Cons: - Denies the ability to test generated types under default QT_NAMESPACE (in addition to user-provided namespace). This is fine as we don't need this feature until we are able to compile QQC2 and modules alike Task-number: QTBUG-99198 Task-number: QTBUG-100103 Change-Id: I13a594a1859719bc0af3370029e6be7b1744656b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 6380f10185c0ec6b444cc9140480dc11f87bc67d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* V4 Date: Support another nonstandard date format QDateTime has droppedUlf Hermann2022-02-032-0/+13
| | | | | | | | | | | | Amends commit 43eaa77e8ed03153335c0002dcc8b660c39a0beb. Fixes: QTBUG-100377 Change-Id: I01028bd991b8a64bd9dcad31ce90536d83dad0a1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 41a5c7b223d958bd40240aee81bb8fb96540735d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip tests that call qmlcachegen when cross-compiledPasi Petäjäjärvi2022-02-032-0/+53
| | | | | | | | | | qmlcachegen is not meant to be available on the target. Fixes: QTBUG-100366 Change-Id: I5cbaa62e85d9a5dd6467840eb4e3ba5e3b63857c Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> (cherry picked from commit d245985f0b7aa698be2bd9c196fd7b9299aa5693) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Decrease number of objects created in tst_QJSEngine::newQObjectRacePasi Petäjäjärvi2022-02-021-1/+5
| | | | | | | | | | | | | | | | This test is so slow on QNX that it times out: QFATAL : tst_QJSEngine::newQObjectRace() Test function timed out QObject: Cannot create children for a parent that is in a different thread. (Parent is QGuiApplication(0x169b0a6b90), parent's thread is QThread(0x37eb7070f0), current thread is QThread(0x37eb734150) FAIL! : tst_QJSEngine::newQObjectRace() Received a fatal error. Task-number: QTBUG-99168 Change-Id: I623bff212b8334af60198e52bc283cc97187c3a7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 7fcc9c7f5848ac8c8264341dca7a0b5a3f0dec94)
* JavaScript: Make "this" available in blocks inside arrow functionsUlf Hermann2022-02-021-0/+22
| | | | | | | | Fixes: QTBUG-98039 Change-Id: I51ff36994fa0f3f3568c8114cb6841f677f64bc4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit eeec9f03e9cf57e8cde311897f7e3e62a217da15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve testing of resizing in the rendercontrol autotestLaszlo Agocs2022-02-021-24/+47
| | | | | | | | | | | Drop the unnecessary calls to create and setRenderTarget. At the same time, start testing that resizing really works as expected. Change-Id: I8d60219767fded8069a79abaf5ce85c1cd678974 Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 991ca56147a8465ea677fe5f430e20439dd94f12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Include upper case .js and .mjs files in qmldirUlf Hermann2022-02-027-2/+16
| | | | | | | | | | | You can use them as singletons. Fixes: QTBUG-100326 Change-Id: I8e07600657bd43ba8376279ffe39cfa5d3213c38 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bf38043b6107cb10bca4be78ecc8bbc20338a61b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Blacklist tests because not supported for software renderingPasi Petäjäjärvi2022-02-024-0/+15
| | | | | | | | | | | For QNX tests are run on qemu with offscreen plugin and software rendering. Change-Id: Idda75387bb7b2a4fc9117a442e307a2b741bc5c5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 11dacf93669ac68b212e343b996a076c8b16ef97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Blacklist tests that failsPasi Petäjäjärvi2022-02-025-0/+5
| | | | | | | | | | | | QNX tests are run on CI in qemu using offscreen qpa plugin and software backend similar like b2qt. See QTBUG-95750 Task-number: QTBUG-95750 Change-Id: I4c6e4a513f8289d50922259e474a41173c29224b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 8dc54c99fdab33603b68595d9f0e1a6eaccf5dd6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Blacklist flaky qquickpointhandler testPasi Petäjäjärvi2022-02-021-0/+1
| | | | | | | Change-Id: I94d1f1c2b5afe7a20d1554238a223c3c002c8428 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit c97955b39db4ecfa22ec211b1b6b0e7b4422e13f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: suppress QEXPECT_FAIL() on two tests it passesPasi Petäjäjärvi2022-01-311-2/+2
| | | | | | | | | | | As QNX's support for feature timezone uses the TZ backend, V4's Date.timeZoneUpdated() works, as on Linux, so tests for this method now pass. Change-Id: Ie6c318023bdf508d9f2067ca3fa9d77b78292be5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9c63dfd249aeeacc5c1573b6cfe4176fb9480f25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Distinguish property change signals from user-defined signalsAndrei Golubev2022-01-312-0/+32
| | | | | | | | | | | Do not expose this information to qmltypes just yet, though, as this seems irrelevant at the moment Change-Id: Iffd8901ef9899a0fff226e8799bf45c1d688b92b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b1bb4c8e5f0d4a65f36b2002bcdaf9bfcbed8c77) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Cannot run qml only testsPasi Petäjäjärvi2022-01-291-1/+1
| | | | | | | | | | | QML only tests expect to run with qmltest tool and since QNX autotests are run on Qemu that does not work. Task-number: QTBUG-100202 Change-Id: I21732c312486d07e0902b9235a7f8cb84eb5e045 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 98d4a44ecfa0c1afe3e58605f56937f20072d281) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Disable host debugging related tests when cross compilingPasi Petäjäjärvi2022-01-291-14/+18
| | | | | | | | | | | Disable tests that are meant to check debugging features using host binaries. No point running those tests on actual targets. Change-Id: If020dfa00410668a305013254617fd50a0a01175 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 584c912dbbdc2b6f746b22e651cc57c1835c8d35) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Disable ecmascriptestsPasi Petäjäjärvi2022-01-291-1/+1
| | | | | | | | | | | | | | | For QNX tests are run on qemu which is slow so the tests will always timeout. As currently timeout is set to env via CMakeLists.txt it does not have effect on QNX as that env variable is not passed over SSH connection. Running tests on QNX qemu takes ~30min: PASS : tst_EcmaScriptTests::cleanupTestCase() Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 1782249ms Change-Id: Ief1ccb05ce21bf3140554272708c95ca5515bc23 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 856df4380a467d0a5554232d213d549fe8a94d0d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNX: Force logging to stderrPasi Petäjäjärvi2022-01-291-0/+5
| | | | | | | | | | | | | | | | | | Sub-process output is by default going to slog2 in QNX so we need to force output to stderr instead. 1: FAIL! : tst_qqmlapplicationengine::application(delayed quit) 'QString(testStdErr).endsWith(QString(expectedStdErr))' returned FALSE. ( 1: Expected ending: 1: qml: Start: delayedQuit.qml 1: qml: End 1: 1: Actual output: Task-number: QTBUG-76546 Change-Id: I4a7b6c25b079f7dcc479fc2bcbd3b079bd7bc519 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5bc77e9b9c9ee878e31dbf6b0254b7cdee81d73c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use up-to date LGPL license headerKai Köhne2022-01-273-33/+42
| | | | | | | | | | | | Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3 instead of LICENSES.LGPL3. See also 5d4679289bc for a similar commit in the past. Change-Id: Icbe5eea7bb7b9c5d46cdd56fa3b177d2e22a5fa9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f3e4ecfbffa19facb12800ae41f261ff3bfdac63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Rename CMake command's argument FILES -> QML_FILESAndrei Golubev2022-01-271-2/+2
| | | | | | | | | | This way we make it consistent with qt_add_qml_module() Fixes: QTBUG-100214 Change-Id: I9f38a8ba3dec978ccdf4ea937ff662ae2449e582 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 97123dbe6755a787e93797f717f8ebf193352b85) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Enhance tst_qmltc::componentTypes() by verifying that ids are correctAndrei Golubev2022-01-271-0/+9
| | | | | | | | | We can in fact check that the ids match to correct objects Change-Id: I46ed1a3d0a9ef429670fdc0438a5d717971c459c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit feaed5f7aa6c82d9132e71037007b7c91ea57713) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't blacklist tst_QQuickFramebufferObject::everything on b2qtShawn Rutledge2022-01-271-0/+1
| | | | | | | | | | | | | Put back the [testInvalidate] condition accidentally removed while removing the first of the platforms it formerly guarded. Amends 6336763588b45a2eeae6af29f5e4ba705b64b4d6 Task-number: QTBUG-64470 Task-number: QTBUG-65614 Change-Id: I494c3359c027696dae795874e1f0337102738fe7 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit affde02775e24047ff6e61651a3095654d2e3bba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_basic missing resourcesAssam Boudjelthia2022-01-272-1/+10
| | | | | | | | | | bundle all data resources and make sure all imports and bundled. Task-numer: QTBUG-97056 Change-Id: I0711675d6c2a9a79790ec460e419c65d581e6ec9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b44ee5022cd0418d97df7c467a209a0d1c24cff3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing dependencies to tst_qmlcppcodegenUlf Hermann2022-01-261-0/+6
| | | | | | | Change-Id: Ifb5af14faa8229d4f7025d275147044629f4f2cb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 672891354220c05a712663d637e5c5d0074a3181) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Host only testsPasi Petäjäjärvi2022-01-252-6/+10
| | | | | | | | Change-Id: I7c0f65868258bd706d9c55022d3546f2b1cb771a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 3199567e96027e32f50d702ba65dede370cbd93e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip tests that fail on platforms that don't implement grabWindowVolker Hilsheimer2022-01-244-4/+4
| | | | | | | | | | | Replace QEXPECT_FAIL with QSKIP so that we can fix the offscreen plugin, and then re-enable tests that pass without having to orchestrate with the dependency updates. Change-Id: Ifdf7fe85a5005f30d2edcba958ff0e9c6c9000b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a3924b9846f8f3412e6cfc3704f69488e64da98e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip the shapes tests on offscreen platformShawn Rutledge2022-01-241-10/+10
| | | | | | | | | | | Replace QEXPECT_FAIL with QSKIP so that grabWindow can be fixed in the offscreen plugin without XPASS-failing tests in qtdeclarative. Task-number: QTBUG-99962 Change-Id: I470061a324c963e09b9ebcb48daabdf8d960ff90 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5d2ffc03f89d092f46ae14e958bedf9fc441b7ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTreeView: be able to expand rows that are not yet visible in the viewRichard Moe Gustavsen2022-01-241-0/+25
| | | | | | | | | | | | | | | | | | If the app expands a row in TreeView, that row will for a brief moment be expanded in the proxy model, but not in the view, until the view is polished. For that reason, when determining if a row can be expanded or not, we should check the state of the proxy model, and not the view. Note: if the application needs the state of the view to reflect the state of the proxy model immediataly after a call to expand, forcePolish() is always possible. Task-number: QTBUG-91374 Change-Id: I5b85e0b5c3b32d17f93409153041df3fc2437424 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit a43912865e294f2014f03eb7073ecd9ecf387623) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't cross-compile qjtestAlexandru Croitor2022-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was only excluded on ANDROID, but cross-compiled for other platforms. The executable should only be built when the target Qt is meant to be used as a development SDK, to be executed on some host machine. Because at the moment we lack a proper abstraction for that, as a work around, we exclude building it when cross-compiling. The executable is not called automatically by any test, it is only run manually by a developer. In the future, the qt_internal_add_tool call should likely be replaced by a customized qt_internal_add_app call, installing the executable into $prefix/libexec rather than $prefix/bin. Amends 5a55e526382f0bb6eb647c2e6b7ce55661889990 Task-number: QTBUG-92591 Task-number: QTBUG-100040 Task-number: QTBUG-100047 Change-Id: If20e73fe378acd51fe41d181078d273a7842fc81 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0de113d37924b7403b74eea4a92fe2b62c557247) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip borderImageMesh test with the software backendLaszlo Agocs2022-01-241-0/+7
| | | | | | | | | | | | ShaderEffect (and BorderImageMesh) do not do anything with the software backend so the results of a scene with an effect in it cannot possibly be compared with the output from another (non-effect) scene. Fixes: QTBUG-100046 Change-Id: Ie2504971f423f68d5be381a71de459ca81af7894 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c96fbe3e565a88427141160932115c09a1bdeef9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Handle ID lookups of incomplete types correctlyUlf Hermann2022-01-223-0/+21
| | | | | | | | | | | Incomplete types are generally stored in some wrapper type. We cannot just assign to the accumulator. Also, we already know whether we have an ID lookup there. No need to determine it again. Change-Id: I1f9fd9f147c44975df33fe862523987d8e711905 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3747c02fe64fbf5496dc540402dddadb1fa33c12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Add C++ name also for types with no export candidatesUlf Hermann2022-01-212-0/+6
| | | | | | | | | | | Even if the type is only exported in a newer version of the module, we still need to know about it in an earlier version, in order to resolve base types. Change-Id: Ibc7940308e3c4aaebf9871a159e1d85f43cd7693 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 24e5b9090b513861e77dcb17b8e4d75f0bdf8651) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlProperty: Prohibit ID lookup on explicitly given objectUlf Hermann2022-01-211-0/+2
| | | | | | | | | | | If an object is given, we should only use that object. Amends commit 21f15ede606df028479335c64c333db5fb1bb3f7. Task-number: QTBUG-100110 Change-Id: I51c0a44750c31984ba4937fb1cd2405dd93fcc19 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 44ca135c5a4d02ab29b57a3f15b84850aafb1cec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tests: port to QMutableEventPoint static APIMarc Mutz2022-01-214-54/+54
| | | | | | | | | | | | | This code was actually ok (no UB), but it's in the way of making QMutableEventPoint a befriendable namespace, so port from using QMutableEventPoint to QEventPoint instances + QMutableEventPoint static setters. Task-number: QTBUG-99615 Change-Id: I7ddcf154cb5da9b6ea2f0f0d8cac130a28203371 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit c096435c307c610fe2dd3f177a1705b86d3631ab) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* QmlCompiler: Respect revisionsUlf Hermann2022-01-214-5/+38
| | | | | | | | | | | | | | | | | | | | | | | The only place where revisions matter is at the boundary between composite and non-composite types. The revision of the first composite type inherited from determines which members of all composite ancestors are available. Therefore, store the revision together with the base type and pass it through the imports to have it available. Then use it to check availability of methods and properties. The test exposes two further problems, which are fixed, too: 1. If no method is found to call, we need to generate an error in the type propagator. We don't know what the call will result in, after all, and the code generator should reject it. 2. We need to check the right scopes for hasOwnMethod(). Otherwise we might not find methods that are available. Fixes: QTBUG-99128 Change-Id: I4c320b8dfb490b140d7b8c16e6b638b32f156faa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e19d48d07310708e56cb379124dff193c1a7fa71)
* TabBar: allow wheel events to change currentIndexNoah Davis2022-01-211-0/+49
| | | | | | | | | | | | | Setting wheelEnabled to true allows wheel events to increment or decrement the currentIndex. We keep track of the total amount of angleDelta so that touchpads and high resolution mouse wheels don't change the currentIndex too rapidly. Fixes: QTBUG-99619 Change-Id: I9bda828338ee5136efcdd6abeca8e5be15da0822 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 2ead10bf55733defe58616de7fe2c28452d00c93) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickListView: Stop overlap for section and firstItem delegatesOliver Eftevaag2022-01-202-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The first delegate after a section delegate would have the same position as the section delegate, if the section delegate is invisible during initialization. In case the section delegates become visible later on during program execution, the delegates would be re-positioned again in the QQuickListViewPrivate::layoutVisibleItems function. But this would not call setPosition for the first item (delegate). It would only call setPosition for all delegates after the first one. This would mean that the position for the first delegate would never be updated, after the delegate was first created. Solution: Call FxListItemSG::setPosition() for the first item in QQuickListViewPrivate::layoutVisibleItems, just like we're already doing for all the items after the first one in the for-loop. Fixes: QTBUG-94848 Change-Id: I34a5ada336ab507b31e3675a1c11eba066fa139a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 3aad05bc09f40d81df7748cbc246974230a3ca17) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document qmltc toolAndrei Golubev2022-01-191-0/+5
| | | | | | | | | | | | | | | Add initial qmltc tool documentation with introduction, compilation process picture, description and limitations To simplify the description, we can consider some simple application. The same app can additionally become a test scenario for qmltc and a showcase of its capabilities Task-number: QTBUG-84368 Change-Id: If6d586a8c68f48d17133b25170d0fff627e2066c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit de30f10aeb1ccf495cf39b3910e89d60f3dc591a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with tests when qtshadertools is not availableJoerg Bornemann2022-01-181-0/+4
| | | | | | | | Fixes: QTBUG-99888 Change-Id: I07638d31c3978a551f3beedd4dbaf329c1445bc7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3bfba0424bdc2f47188509a13132e7299330388a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Handle context push/pop in dead codeUlf Hermann2022-01-183-0/+34
| | | | | | | | | | Otherwise we end up with unmatched curly braces in the generated code. Change-Id: I4c24d4062a8ed54cd6a9ecb43dfd2b5d0a26c9e1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 6a54c6013d9037f5c75d47f5e03d6871591e53b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Construct multi-part URIs with '.' rather than '/'Ulf Hermann2022-01-184-0/+17
| | | | | | | | | | | This is how URIs are defined and how we store them in our caches. Without this, we cannot find modules with multi-part URIs imported using -i. Change-Id: I86b02b2c2102a2d4edd8c20388c6cd9b1e92b0ff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b245faae89f3b76890a9b49a2a1a5ee4b1568d28) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: Do not generate bindables and setters for QQmlListPropertyUlf Hermann2022-01-182-2/+12
| | | | | | | | | Assigning to a QQmlListProperty does not do what you think it does. Change-Id: Ie6ac3208d552d8f40d9f2f4d7fb33c1cd64e4b79 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 134f305b7f96e1a127261bbfac9bdb1f3a22e546) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_baseline_scenegraph: Remove unused private fieldMaximilian Goldstein2022-01-171-1/+0
| | | | | | | | | | | This caused clang warnings and doesn't seem to have any use anymore. Change-Id: Icc34cddbd32b2e59df662ae1e3796c7b3aae1155 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 6e4dd74bbcb6c67229c87c3113c006df4f11847a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ShaderEffect: Make uniform setting saferLaszlo Agocs2022-01-176-0/+117
| | | | | | | | | | | | | | | | | | ...to better match the Qt 5 behavior. For example, trying to assign a Qt.point() to a vec3 works in Qt 5, setting the 3rd component to 0, because it just does a blind call to glUniform2fv. In Qt 6 this was not done initially, and the data copy is based on the value's size, so one either gets an assert in debug builds, and perhaps a crash or some strange behavior in the shader in release. Make this safer. The handling of QTransform->mat3 was broken as well, although it is unlikely anyone ever used that in practice. Fix it so that we properly map the 9 floats to the 4-float-per-column layout. Change-Id: Ia4a24bff0e54d94ddb2f5db276f0ed0a2cde0efd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit c4f49a9e1f2c5a7819495f567f5ffe32d0eb468b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port users of QMutableEventPoint::from() to new static settersMarc Mutz2022-01-162-5/+5
| | | | | | | | | | In QQuickItem, added an opportunistic std::move() as a drive-by. Task-number: QTBUG-99615 Change-Id: Ib9426ae7e749036541d5f97824800636b5ccfb5e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit f988168432068f04c0f9a0c485bc1c6584f0aa5e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-allow retrieval of list properties in QQmlJSCodeGeneratorUlf Hermann2022-01-155-0/+44
| | | | | | | | | | It's not particularly slow. It probably was when we were using QQmlListReference or JavaScript arrays. Change-Id: I1a4575a5b84cdfb732a6c3615d00bbe2abaffc94 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> (cherry picked from commit bd0f4459ce31b6c5f232d60e7cdc3d9e0cb84ad7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickAbstractButton: fix crash on destructionUlf Hermann2022-01-141-0/+23
| | | | | | | | | | | If we listen for size changes we also need to remove the object listened to when it's deleted. Fixes: QTBUG-99644 Change-Id: I613855ebd986b1e67685088020b88d8b070659cf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 720ffaeb60d43123522066e1de3a69ad551644aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmljstypepropagator: Add compiler error for unknown function callsMaximilian Goldstein2022-01-131-0/+2
| | | | | | | | | | | Previously we would not generate an error when an unknown function was called. Change-Id: I31845a642afe0fd6038228c4aabf2ef5c6f1140e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit fddd82345ae63f1769f5fc9e486cfdccea4d0124) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't rely on transitive include of qeventpoint_p.hMarc Mutz2022-01-135-1/+6
| | | | | | | | | | | It will be dropped from qevent_p.h. Task-number: QTBUG-99615 Change-Id: Id4eee3036a873f0e021b30a8d43b2c4df25dc53c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit bec4d008c22340b1913c1871ae57a4b9b675acad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>