aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktestutils/quick/visualtestutils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v6.5.8-lts' into tqtc/lts-6.5-opensourcev6.5.8-lts-lgplTarja Sundqvist13 days1-0/+4
|\ | | | | | | | | | | | | | | | | 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)
* | Merge tag 'v6.5.7-lts' into tqtc/lts-6.5-opensourcev6.5.7-lts-lgplTarja Sundqvist2025-10-091-2/+2
|\| | | | | | | | | | | | | | | | | 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)
* | Revert "Update commercial SPDX-License-Identifier"Tarja Sundqvist2025-06-021-1/+1
|/ | | | | | | | | | 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-271-1/+1
| | | | | | | | | | | 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-131-1/+1
| | | | | | | | | | | | 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-281-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-0/+15
| | | | | | | | | | | 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-131-0/+4
| | | | | | | | | | | | | | 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>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | 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 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>
* QQuickApplicationHelper: move initialProperties before qmlImportPathsMitch Curtis2022-06-151-1/+2
| | | | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-06-111-27/+2
| | | | | | | | | | | | 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>
* QuickTestUtilsPrivate: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | | 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>
* 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>
* Consolidate test helpers into private librariesMitch Curtis2021-09-131-0/+225
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>