aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktestutils/quick
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v6.5.8-lts' into tqtc/lts-6.5-opensourcev6.5.8-lts-lgplTarja Sundqvist2025-12-033-49/+86
|\ | | | | | | | | | | | | | | | | Qt 6.5.8-lts release Conflicts solved: dependencies.yaml Change-Id: Id2eeb915139bdd1943ffc498173db540f22ca2f3
| * QQuickVisualTestUtils::compareImages: fail if image depth is not 32Mitch Curtis2024-11-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function would ignore the depth and read memory that it shouldn't, which can cause hard-to-diagnose failures, and heap-buffer-overflows when ASAN is enabled. Mismatches in depth can happen when optimizing images with optipng, for example, which may convert color images to grayscale. compareImages was added in 7ffea4048321b86402a9ded5255ad16ac74d0518. Change-Id: Id83dcd79ae94088996ff770d90b2c1add910fb1b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit a5412bece857c5e2742a9cc2dc2e65539416a17b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 978213a20472911ff77eac71dd4748ee09943754)
| * Replace mouse-only flick, moveAndPress, moveAndRelease in testsShawn Rutledge2024-10-172-49/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since d7623d79ef4bc9533fced027bf1d173d68b4eba6 Flickable has worked directly with touch events; and we are expected to have stylus devices (QTabletEvents) working well too. So we need to be able to expand the test coverage to more types of devices. This is the first step. The high-dpi scaling is from 0debcf3ed3f62416be1c172454f420119df0587e. Change-Id: I93a3a4b84424eb69e0cd7c9f4ebe58b9f27082d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 99c6706b9208fcdf2e48f14bcd3f961567838ea4) Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge tag 'v6.5.7-lts' into tqtc/lts-6.5-opensourcev6.5.7-lts-lgplTarja Sundqvist2025-10-092-2/+8
|\| | | | | | | | | | | | | | | | | Qt 6.5.7-lts release Conflicts solved: dependencies.yaml Change-Id: I8fbe9c1606825b726adf95e69a4fa86e2196f4e8
| * QQuickVisualTestUtils::compareImages: actually check all colorsMitch Curtis2024-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was added in 906d5c5c40183468f9521277c6244a6c46730de6. The tests there don't only use red, so it looks like this bug has existed since 2013. Change-Id: I4bdf87fe6be0224016baf9a2a80faee6fe61514e Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 74c019e799fab74b85cd444c1e104638b7dd6c96) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 1eaef559a616ff9b2acb86f82c154e57b9f75168) (cherry picked from commit c258f31173a020e9736132f7deb15eb2d5725f0e)
| * Move duplicate WindowActivation checks into a skip macroMitch Curtis2024-05-301-0/+6
| | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-124230 Change-Id: I617f851cd2b2b1a4f4c3dada2e4ebdf5c4be18fd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 8d454b26263e5333d8475bbab91d7b3d1d5e04d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5b9936485a832cbfed509def30b3125d626932e3)
* | Revert "Update commercial SPDX-License-Identifier"Tarja Sundqvist2025-06-026-6/+6
|/ | | | | | | | | | This reverts commit 6517e8df24d2381e951b9ec3e0cda2ae33edac37. Commercial SPDX license identifiers need to be removed from the opensource release. Change-Id: I60f8c76ace400db6182e012c8aae050d13d262e9 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* quicktestutils: document isDelegateVisibleMitch Curtis2024-03-271-0/+6
| | | | | | | | | Change-Id: I63c5d453a52df49ef0ce4a4d49c23ad5fe682824 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 4566f5186196bcd04d4e468fe990b206dec350ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit cac8461c9418ece2fec93a58aee2ebc1bf010ce7) (cherry picked from commit d7d4c4216b16a162ee3a698429591d92a45af4c2)
* quicktestutils: rename delegateVisible to isDelegateVisibleMitch Curtis2024-03-272-2/+2
| | | | | | | | | | | Because it's the convention. Change-Id: I1d3d53f5c051ede0b011c1daa9d1019cad8875f8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 617476d45bab183741ee0a1579d1b2b6f58658ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c4aea235df08b92f7ba2405ad148b89c8bb86b96) (cherry picked from commit e68d4ab8a6958de275f60905dd894733511dd817)
* Update commercial SPDX-License-IdentifierTarja Sundqvist2023-12-136-6/+6
| | | | | | | | | | | | Some files in tqtc-qtdeclarative were missing the commercial SPDX-License-Identifier. Build files, examples, tests, or documentation are not updated. Task-number: QTQAINFRA-5900 Change-Id: I2cad9a7a271b0b3f3af3074259614b890b266a91 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 132fe2df41fc5e69fec39440b35137d5f0d63f6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add PointLerper to QQuickVisualTestUtilsMitch Curtis2023-06-282-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a convenience class to linearly interpolate between two move points: PointLerper pointLerper(window); // Lerps from {0, 0} to {15, 15}. pointLerper.move(15, 15); QVERIFY(parentButton->isHovered()); // Lerps from {15, 15} to {25, 25}. pointLerper.move(25, 25); QVERIFY(childButton->isHovered()); This allows testing mouse interaction in a more realistic manner, as opposed to immediately moving to a new position with no intermediate move events. More importantly, it fixes flakiness in tst_qquickpopup hover tests. Includes an attempt to stabilize tst_QQuickDrawer::multiple() which seems to crash due to events arriving after window destruction. Task-number: QTBUG-114718 Change-Id: I4b466d820cec4113a9d266685c4575a3692e5202 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 2adaa51d6fa7952013c592d2a8a75814112ee247) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add coordinate-mapping convenience functions to QQuickVisualTestUtilsMitch Curtis2023-06-202-0/+19
| | | | | | | | | | | These make it more convenient to map relative coordinates to the window coordinates expected by QTest functions. Change-Id: Ib931af8bda3510209e5ef833e22a0ed3272dde59 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 8edc526f4362ba00246f192bc9e114c356c896b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with -no-feature-listview and itemviewsTasuku Suzuki2023-04-134-0/+14
| | | | | | | | | | | | | | tested with each/all of below -no-feature-gridview -no-feature-listview -no-feature-pathview -no-feature-tableview -no-feature-treeview Change-Id: I90cc7bc45bb9065000bc0fc7eeb8e80f02acb0d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 922c89cf955f5703fca015f25e681cbcc783d580) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTest::initView: set minimum window width and height if unsetShawn Rutledge2022-10-241-0/+4
| | | | | | | | | | | | | | | When writing a new test, it's easy to forget to set the root item's width and height, and that's ok on any desktop platform: the QPA plugin or the window system will give it a reasonable minimum size anyway (100x100 or so). But on some embedded platforms the minimum window size is much smaller, such as 1x1; and then we can end up with CI failures that take too long to troubleshoot. So if width or height is not set (and thus 0), set it to 100. Fixes: QTBUG-107865 Change-Id: If6c300d6ff43e3ba8d9142c550579ef7d58d87fb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickTest::pointerPress/Move/Release convenience functionsShawn Rutledge2022-10-202-0/+98
| | | | | | | | | | | | | | | | | | | More autotests should test mouse, especially touch and maybe tablet events, with similar expectations, instead of testing mainly mouse and mostly neglecting the other device types. This makes it easier to work with data-driven tests that take specific QPointingDevice instances as test data. Started using them in tst_TapHandler::gesturePolicyDragWithinBounds() which was already data-driven by device type. Clearly, this code is now easier to read and less repetitious. In tst_qquickwindow::subclassWithPointerEventVirtualOverrides() the improvement is somewhat smaller, but this test validates that tablet events are working. Change-Id: I74d0fcc2f082af3737a0754c58205fa2b18c1a2d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-073-20/+20
| | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove Qt key words from header filesYuhang Zhao2022-07-192-2/+2
| | | | | | | | | | | So that users can use QT_NO_KEYWORDS when linking against QtDeclarative, even if they are using private headers. Docs, examples and tools are not touched because it's not necessary. Pick-to: 6.4 Change-Id: Idc30797074aaa72576429ebdaaf915d7f5acf84e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove flushFrameSynchronousEvents from qquickwindow_p.hJohan Solbakken2022-07-171-1/+1
| | | | | | Change-Id: Ib1ae19eac2a5a95b71345b80075f871ea82fa928 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* findItem: don't return items with invalid QQmlContextsMitch Curtis2022-06-161-1/+4
| | | | | | | | | This can cause flakiness in tests. Fixes: QTBUG-75109 Pick-to: 6.2 6.3 6.4 Change-Id: I07c2a4d86076fe8b07df9425660542babbda2c1a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickApplicationHelper: move initialProperties before qmlImportPathsMitch Curtis2022-06-152-3/+4
| | | | | | | | | | | It's far more common to want to initialize certain properties in the QML file, so this should come before qmlImportPaths so that users of the (private) API do not need to pass an empty QStringList (for qmlImportPaths) each time they want to provide initial properties. Pick-to: 6.2 6.3 6.4 Change-Id: I91ee4f1c1d69c83de3800af2f704c4c8a19d812d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* quicktestutils: remove duplicated function declarationMitch Curtis2022-06-131-2/+0
| | | | | | Pick-to: 6.2 6.3 6.4 Change-Id: If3fc379cbc9517470ce0726671e2451c38204da9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* quick/controlstestutils: add [[nodiscard]] to functions returning stuffMitch Curtis2022-06-132-6/+8
| | | | | | | | This way we'll get warned when the return value is not used. Pick-to: 6.2 6.3 6.4 Change-Id: If93abf2760b2ae3165720512c7d7f8dfa2600cf4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-116-162/+12
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QtQuickTest: add API for checking for polish at window levelMitch Curtis2022-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a qIsPolishScheduled(QQuickWindow *) overload of qIsPolishScheduled(QQuickItem *) (added in 40d6072bc8a4df0fe1a16025fe30fe653463a446) and deprecates qWaitForItemPolished() (added in 7a3cad0619662b992154e075ec6b840bfc8a46a7) in favor of qWaitForPolish(), which has QQuickItem* and QQuickWindow* overloads. The existing functions that take QQuickItem are useful, but testing Qt Quick applications can be made even easier by allowing users to check if a window has any items that need to be polished. This information is already present (in QQuickWindowPrivate::itemsToPolish), so it's very efficient to check for. This is especially useful now that Qt Quick Layouts using polishing for their layouting, for example, as it's no longer necessary to find individual polishable items in complex hierarchies before proceeding to interact with child items. [ChangeLog][QtQuickTest][QQuickTest] Added QQuickTest::qIsPolishScheduled(QQuickWindow *) and QQuickTest::qWaitForPolish(QQuickWindow *) functions for verifying that updatePolish() was called on one or more items managed by a window. [ChangeLog][QtQuickTest][QQuickTest] Deprecated QQuickTest::qWaitForItemPolished(QQuickItem *). Use the new QQuickTest::qWaitForPolish(QQuickItem *) function instead. Fixes: QTBUG-93757 Change-Id: I95b6e051b3c9fd2fa93604f4d9ccda486bb29f9d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace uses of deprecated _qs with _s/QStringLiteralSona Kurazyan2022-04-291-1/+3
| | | | | | Task-number: QTBUG-101408 Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QuickTestUtilsPrivate: includemocsMarc Mutz2022-04-293-0/+6
| | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102948 Change-Id: I3c9d74e94b0fbbf1e5e9d59522f400485c959cb5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make sure all private headers include at least one otherThiago Macieira2022-03-102-0/+2
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Replace 0 pointer constants with nullptrAllan Sandfeld Jensen2021-10-181-1/+1
| | | | | | | Replaced in most common patterns. Change-Id: Idcaff1f2e915f29922702d3600a2e5f1e2418a7a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix codechecker complaint about QString from string literal constructionFabian Kosmale2021-09-171-1/+1
| | | | | | | | This addresses the codechecker issue with hash 9244a63961d4d2bede8fc8dc2972e65b. Change-Id: Id2781610e8a7566de66a099d302220bee1db5896 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Consolidate test helpers into private librariesMitch Curtis2021-09-136-0/+1302
Previously each test would include and build sources from the shared folder. Now we make those sources a library, build it once, then have each test link to it instead. We also take the opportunity to move some helpers that qtquickcontrols2 had added into the quicktestutils library where it makes sense, and for the helpers that don't make sense to be there, move them into quickcontrolstestutils. We add the libraries to src/ so that they are internal modules built as part of Qt, rather than tests. That way we can use them in a standalone test outside of qtdeclarative. Task-number: QTBUG-95621 Pick-to: 6.2 Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>