summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-1719-45/+1
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QGraphicsView: fix jumping graphic items when dragging out of viewTaras Kachmaryk2022-11-261-0/+108
| | | | | | | | | | | | | | | | | | | | | The algorithms for calculating the scene's position within the view did not compensate for scrollbars showing. The scrollbars should be ignored when positioning hte scene within the view, as alignment only cares about the positioning of the scene when the view is larger than the scene anyway. Add a test case that verifies that items don't jump up or down when dragging horizontally, and not left or right when dragging vertically. Mark variables in the modified function as const where applicable to make it easier to follow the code. Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Fixes: QTBUG-46757 Change-Id: If205637dfe124e0034f68201b23f174d6863084d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QGraphicsEffectSource: Reset effect repaint count after flushing eventsTor Arne Vestbø2022-11-081-1/+1
| | | | | | | | | | | | | Follow-up to 8222e06d12a4e2a84ce1161abd0ceb58622c740b, which only reset the item repaint count. Flushing the queued paint events will bump numRepaints, and the whole point of calling reset() is to prepare a consistent state before the next test, so we need to call it after flushing the events. Pick-to: 6.2 6.4 Change-Id: Id1fe840c14c0940d7020cf8f8cc6a3aeceaa5fb5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QGraphicsEffectSource: Reset repaint count after flushing eventsTor Arne Vestbø2022-11-051-1/+1
| | | | | | | | | | Flushing the queued paint events will bump numRepaints, and the whole point of calling reset() is to prepare a consistent state before the next test, so we need to call it after flushing the events. Pick-to: 6.2 6.4 Change-Id: Iaefc9854caafe82c65c9587e18fd081439e8dda6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-039-154/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tests: skip tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() on WaylandLiang Qi2022-10-211-0/+3
| | | | | | | | | | | QWindow::requestActivate() is not supported. This function crashed very often in ci/coin when system is busy. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: I82523080db40bddce9c9dc000433117d8ef74847 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tests: skip tst_QGraphicsProxyWidget::scrollUpdate() on WaylandLiang Qi2022-10-211-0/+3
| | | | | | | | | | | QWindow::requestActivate() is not supported. This function failed in test vm in coin manually very often. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: I013651b0e5e7618c29742effd85a091ca95a7414 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-112-7/+7
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* tests: skip tst_QGraphicsView::embeddedViewsWithFocus() on WaylandLiang Qi2022-10-071-0/+3
| | | | | | | | | QWindow::requestActivate() is not supported. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: Ie9583e55d298fe392d8ab09e9a10d8fce5ce3fee Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tests: fix window activation usage in tst_QGraphicsWidgetLiang Qi2022-10-071-7/+25
| | | | | | | | | | | | - Skip tests that depend on programmatic window activation on platforms where this is not supported, such as Wayland. - Change tests that don't rely on the window being activated to use qWaitForWindowExposed() instead. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: Ieb4280343a725a2cbdc46a8ac5c657beeb2e7e57 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tests: skip two tests in tst_QGraphicsProxyWidget on WaylandLiang Qi2022-10-071-0/+6
| | | | | | | | | QWindow::requestActivate() is not supported. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: I41c0c24c73ea5add821109172470d37a9b6211a8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-048-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = 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'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't rely on synthetic mouse events in updateFocusChainWhenChildDie testTor Arne Vestbø2022-09-142-9/+3
| | | | | | | | | | | | | | | Synthetic mouse events are not reliable, as the platform might restrict synthetic mouse moves. In addition, the WM might automatically activate the window when the other window is hidden, which makes the EXPECT_FAIL flakey. Since the test was not written to test window activation, let's just explicitly activate the window. Fixes: QTBUG-23699 Pick-to: 6.4 Change-Id: I0ac1d3bc0658dfbd600a1f5d960839860be6dd2c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Blacklist tst_QGraphicsWidget::updateFocusChainWhenChildDie() on macOS 13 in CITor Arne Vestbø2022-09-131-0/+1
| | | | | | | | | | | For some reason when running this test on macOS 13 in the CI the window is activated, as on other platforms, but this is not reproducible locally, so we can't just remove the QEXPECT_FAIL. Task-number: QTBUG-104210 Task-number: QTBUG-23699 Change-Id: Ib1cacb36d90d2be357756c82af2427f2b3ab9999 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Blacklist: tst_QGraphicsAnchorLayout::layoutDirection for Ubuntu 22.04Heikki Halmet2022-08-311-0/+1
| | | | | | | Task-number: QTBUG-87728 Pick-to: 6.4 6.3 6.2 Change-Id: Ic78a17146c265ffe6baf6f08a0f9c29750bd0d58 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Deprecate QApplication::setActiveWindow() and mark as internalTor Arne Vestbø2022-08-276-77/+88
| | | | | | | | | | | | | | The function is used the internal window activation machinery and should not be called by user code. Many tests still use this function, and should be ported over to QWidget::activateWindow(). For now they are using the private helper in QApplicationPrivate, so that we can progress with the public API deprecation. Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2319-19/+19
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_qgraphicswidget: Avoid redeclaration of Size from MacTypes.hTor Arne Vestbø2022-08-211-29/+29
| | | | | | | | | If an included header brings in MacTypes.h it will cause issues, so rename the enum to be on the safe side. Pick-to: 6.4 6.3 6.2 Change-Id: I29ec795be74a65d4f2267d8121a514bf192cf969 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Stabilize test by not activating windowDimitrios Apostolou2022-08-172-8/+2
| | | | | | | | | | | | | | Window activation is not working reliably on X11 when combined with X11BypassWindowManagerHint, see QXcbWindow::requestActivateWindow(). The test itself counts repaints, so qWaitForWindowExposed() shouldn't be needed. This way we don't need to QSKIP() the test if window activation fails. Fixes: QTBUG-98921 Change-Id: I849b7261c757fb7cbcde73f11bbe1a74a862cb9c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update BLACKLIST for tst_qgraphicsviewDimitrios Apostolou2022-08-171-14/+2
| | | | | | | | | | | | | Removed entries that do not reproduce on OpenSUSE and that are no longer flaky in our CI according to our testresults statistics database. Adjusted entry for resizeAnchor testcase which has been seen flaky in RHEL-8.4 and cursor2 which is very flaky on macOS. Task-number: QTBUG-105249 Task-number: QTBUG-105247 Change-Id: I3e258f81d6bbf540a4b3dec763fdfd4bdc511847 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Unblacklist tests that are no longer flakyDimitrios Apostolou2022-08-171-5/+0
| | | | | | | | | Can't reproduce in OpenSUSE, and no flakiness has been seen in the past 6 months in our testresults statistics database. Task-number: QTBUG-63260 Change-Id: I465aa4b9f82726e9685f64b0dc235d3235c4bd9c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix testcase that fails when run individuallyDimitrios Apostolou2022-08-171-1/+1
| | | | | | | | | | | | | | | | Executing the tst_qgraphicsitem::sorting() testcase individually always fails on my KDE/X11 desktop. The window never seems to have focus and the call to qWaitForWindowActive() returns error after a few seconds. It seems qApp->setActiveWindow(&view) never succeeds in giving focus to the window containing the widget. Fixes: QTBUG-105221 Task-number: QTBUG-74760 Change-Id: I148dab09d0fb592376b3902e4ed10799f9a52274 Done-with: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Try to stabilize window activation on macOSDimitrios Apostolou2022-08-101-14/+30
| | | | | | | | Use activateWindow() that is documented as the right way to raise a window. Task-number: COIN-892 Change-Id: Ic9aadee0d3a526fd8e46e5b1099b5b0861700207 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Test is stable on OpenSUSE, un-blacklist itDimitrios Apostolou2022-08-101-1/+0
| | | | | | Task-number: QTBUG-74760 Change-Id: I78ca3779407d1076a11d0a948b61f4438d1ab4cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-0319-0/+57
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-2818-21/+21
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGraphicsProxyWidget: make tolerance in mapToGlobal test at least 4Volker Hilsheimer2022-07-151-1/+1
| | | | | | | | | | a61bf508e3c138c429e0a73498c745c3c0d3f0f7 reduced the tolerance from 4 to 3 in one case, making the test more rather than less flaky on systems with a device-pixel-ratio of 1. Pick-to: 6.4 6.3 6.2 Change-Id: I245443f0dcb1aa40176c127025501b63f12f161b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QGraphicsWidget: skip test if graphics view fails to showVolker Hilsheimer2022-07-141-1/+2
| | | | | | | | | | | | | | | | | | We set Qt::X11BypassWindowManagerHint on the view, which regularly makes the test fail on X11 systems in the QVERIFY(QTest::qWaitForWindowActive(dummyView.data())) check. If the view fails to show, skip the test instead of failing, we are not testing anything X11 specific here, running this test on other platforms will be good enough. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-98921 Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QGraphicsProxyWidget: make tolerance for errors depend on DPIVolker Hilsheimer2022-07-141-2/+3
| | | | | | | | | | The test already accepts an error margin for coordinate mapping. It is still flaky, so make that margin larger if the DPI of the widget >1. Pick-to: 6.4 6.3 6.2 Change-Id: I0a598e5e94ac82c551cbeb935e2fa08cad048f84 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use debug stream in QTest::toString's default fallback if possibleVolker Hilsheimer2022-07-131-1/+0
| | | | | | | | | | | | | | | | | | | | For built-in types, this is a compile-time assert - we should not have any types in Qt for which we have neither debug streaming nor a QTest::toString specialization implemented. A build of most of Qt submodules passes with this change, after minor modifications to some tests. We cannot declare QSizeHint::Policy as a metatype after the QMetaType has already been instantiated for it, and the QDebug stream operator for QElaspedTimer needs to be correctly declared within the namespace. Add a self-test function for a custom type, and update reference files of the self-test. Task-number: QTBUG-104867 Pick-to: 6.4 Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QGraphicsScene: fix -Wsuggest-overrideMarc Mutz2022-07-061-1/+1
| | | | | | | | | | Add the override keyword. Amends 2e12479e06d6869f568f0a7ee939453cda9afdbf. Pick-to: 6.4 6.3 6.2 Change-Id: Ic62dd33b1ee52983481e39e862b9bd87695f5044 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-06-231-2/+0
| | | | | Change-Id: Ifb09a997d39fc2c92503e77cf372d443c13c4c2b Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* QGraphicsScene: respect that items can override selection changesVolker Hilsheimer2022-06-201-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsItems may override itemChange to prevent certain attribute changes. Overriding ItemSelectedChange this way is explicitly documented to be allowed. However QGraphicsScene::clearSelection did not test whether items were in fact deselected after the call to setSelection, and always cleared the stored set of selected items. Fix this by checking the actual selected state of the item as we iterate over them, and store those items that are still selected in a set that becomes the new selectedItems set (which will be empty if no item overrides, which is the default). Add a test that also checks that clearing the selection emits the selectionChanged signal correctly (and does not if all selected items block being deselected). Fixes: QTBUG-85474 Pick-to: 6.4 6.3 6.2 Change-Id: I665afc132876e02e6e1061b7be37f4f6e4be418f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-05-181-4/+0
| | | | | | Pick-to: 6.2 6.3 Change-Id: I7d37dd58eaede1bd0d1b53fe264b45be83cbca57 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1620-540/+40
| | | | | | | | | | | | | 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. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Android: Blacklist failing tests on tst_QGraphicsProxyWidgetSamuel Mira2022-03-221-0/+6
| | | | | | | | | | Backlist failing tests on Android. To be fixed later. Task-number: QTBUG-100470 Task-number: QTBUG-101888 Pick-to: 5.15 6.2 6.3 Change-Id: Iaa33b555f6063702af683c683e0b07ce2910fe13 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* When clearing selected items, iterate over a copy of the QSetVolker Hilsheimer2022-03-181-0/+69
| | | | | | | | | | | | | | | | Selection change handlers of the items might call a method that implicitly recreates the selectedItems QSet, which then invalidates the iterators of the ranged for loop, resulting in crashes. Iterate over a copy of the set instead. Add a test case that crashen without the fix. Fixes: QTBUG-101651 Pick-to: 6.3 6.2 Change-Id: I6da6f4043fe1906b0186931a37283f635cb5a404 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Activate tst_qgraphicsview for AndroidAndreas Buhr2022-02-242-4/+7
| | | | | | | | | | | | | tst_qgraphicsview was disabled because it crashed. It does not any more. Task-number: QTBUG-87671 Task-number: QTBUG-87397 Pick-to: 6.2 6.3 Change-Id: Ib604274d098c271e22b010e6cb822fdf9553df1c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Samuel Mira <samuel.mira@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CI: Blacklist updateFocusChainWhenChildDie for QNXPasi Petäjäjärvi2022-02-171-0/+2
| | | | | | | | | | Tests are run for QNX in qemu similar to b2qt currently (using offscreen plugin and software rendering). So the issue is same. Pick-to: 6.2 6.3 Task-number: QTBUG-100930 Change-Id: Ie973c6c611ac48703fd7cce53925940b80858bc8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Add BUILTIN_TESTDATA option to qt_internal_add_testAlexey Edelev2022-02-111-29/+15
| | | | | | | | | | | Multiple tests use qt_internal_add_resource that copies the functionality that is already implemented inside the qt_internal_add_test function. Simplify these test by replacing the qt_internal_add_resource call with the new BUILTIN_TESTDATA option. Change-Id: I18475b817d6f87264f0de53817d6c26c5ccab4e2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Deprecate QContextMenuEvent and QMouseEvent ctors without globalPosShawn Rutledge2022-02-054-35/+52
| | | | | | | | | | | | | As with QHoverEvent, it's better to require globalPos rather than "initialized to QCursor::pos(), which may not be appropriate" as the docs have pointed out for many years now. This removes the remaining calls to QCursor::pos() in event constructors. Task-number: QTBUG-52430 Task-number: QTBUG-69433 Task-number: QTBUG-100324 Change-Id: I076dae56f37abaad7085cc95dddee453a80a45f3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-171-32/+0
| | | | | | | | Task-number: QTBUG-94446 Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tests: port to new QMutableEventPoint static APIMarc Mutz2022-01-151-7/+7
| | | | | | | | | | | | | | | | | | This code didn't actually use QMutableEventPoint::from(), so didn't run into the UB that from() depended on, but it's in the way of making QMutableEventPoint a befriendable namespace instead of a public subclass of QEventPoint. Replaced the QMutableEventPoint ctor that takes a timestamp, and therefore isn't compatible with the ctors on QEventPoint, with a static function that returns QEventPoint instead. Port QList initialization to braced-initialization as a drive-by. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: If5a1dbea21cc31cdefdb640716793421c8ec0af4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Don't include qeventpoint_p.h from qevent_p.hMarc Mutz2022-01-141-0/+2
| | | | | | | | | | | The header no longer uses QMutableEventPoint. Fix TUs that relied on the transitive include. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: Iae4ff34ea708304fcd365fd763875dd4a97a1cf8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QGraphicsView: fix memleakMarc Mutz2022-01-051-4/+4
| | | | | | | | | | Found by asan. Amends 01aeb5f7e4fd977e9698fffdc7650897664ecb82. Pick-to: 6.3 6.2 5.15 Change-Id: Id61fc1bc1f40494371ac27cb258a22c89db24683 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Stabilize tst_QGraphicsProxyWidget::scrollUpdateVolker Hilsheimer2021-12-221-1/+1
| | | | | | | | | | | | | The test waits a bit hoping that all paint events are delivered after showing the widget so that we can count the rectangles that are getting updated when scrolling. Waiting for 20ms is too short unless the system is completely idle. Based on testing on a local VM, 150ms produces reliable results. Pick-to: 6.2 6.3 Change-Id: I7729e94eae41476be67291a2f664cff784f96c7d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Blacklist flaky tst_qgraphicswidget:initialShow on OpenSUSEDimitrios Apostolou2021-12-171-0/+1
| | | | | | Task-number: QTBUG-98921 Change-Id: Ie2c3bed56fdd548a54035565639803c19819d4be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtBase: replace windows.h with qt_windows.hYuhang Zhao2021-11-231-1/+1
| | | | | | | | | | We have some special handling in qt_windows.h, use it instead of the original windows.h Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77 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>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-7/+6
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Forward touchEvents to children inside QGraphicsProxyWidgetVolker Hilsheimer2021-09-061-68/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies the fix from 1ecf2212fae176b78c9951a37df9e33eb24d4f2d, using QApplication::translateRawTouchEvent to dispatch the touch event received by the QGraphicsProxyWidget to the relevant child widgets under each touch point. In addition, limit the implicit grabbing of each touch point before sending the event to those cases where we have to: touch pads, and if the target widget comes from a closest-widget matching. And don't call the QTouchEvent override of QEvent::setAccepted() on QTouchEvent instances in QGraphicsView classes, as this will override each event point's acceptance state. This way, we can identify which touch points have been accepted after event delivery, any only implicitly grab those points that were. Otherwise, touch points not accepted by a proxied widget hierarchy will still be part of an accepted event, and be grabbed by the viewport of the QGraphicsView. This would then lead to infinite recursion when the QGraphicsProxyWidget passes the TouchUpdate event on to each touch point's grabber. Re-activate the test case, and extend it with more combinations. Refactor touch-event recording to make it easier to test multi-touch scenarios. Task-number: QTBUG-45737 Fixes: QTBUG-67819 Pick-to: 6.2 Change-Id: Id5611f4feecb43b9367d9c2c71ad863b117efbcb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>