aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
Commit message (Collapse)AuthorAgeFilesLines
* Don't discard return values from no-discard functionsVolker Hilsheimer2021-03-181-2/+2
| | | | | | | | | | The tests are very likely to fail if window exposure fails, so verify that it doesn't. Change-Id: I484d10e6bf8fdf5199bef070198f5405ab8f249b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 80ee53c07c425f3d469dab5824572031fde6405e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use logical OR to test boolsVolker Hilsheimer2021-03-181-1/+1
| | | | | | | Change-Id: I021c3354932584cb976d3529ff47f7a826731336 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 955181ebc554240cd8fa792a125369aeb56a2eb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist tst_qquickitem::hoverEvent on boot2qtShawn Rutledge2021-03-041-0/+3
| | | | | | | | | Suddenly we get 3 hover moves when there were only 2 mouse move events. The reason is not yet clear. Task-number: QTBUG-91548 Change-Id: Ib65194639aa059ae6ee0324b3faf2cfb7d234e1e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Move event delivery from QQWindow to QQuickDeliveryAgentShawn Rutledge2021-02-254-16/+25
| | | | | | | | | | | | | | | | | | | | | | QQuickWindow owns QQuickRootItem which owns QQuickDeliveryAgent, so for every window there's an object responsible for event delivery, while the window itself is mainly responsible for rendering (separation of concerns). However, QQuickRootItem and QQuickDeliveryAgent can now be used in cases where the scene doesn't directly belong to a window, such as when a Qt Quick sub-scene is mapped somewhere into a Qt Quick 3D scene. In that case, we must remember which delivery agent was in use at the time when a QEventPoint is grabbed and deliver subsequent updates via the same DA. There's also a QQuickDeliveryAgent::Transform abstraction which subscene-management code (such as QQuick3DViewport) can implement, to provide a formula to map the window's scene coordinates to subscene coordinates; if defined, it will be used during delivery of subsequent updates to existing grabbers. Task-number: QTBUG-84870 Change-Id: I70b433f7ebb05d2e60214ff3192e05da0aa84a42 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 68c103225f4e8bd6c1b18ef547108fd60f398c0f) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qquickdesignersupport: skip crashing testsSamuli Piippo2021-02-193-7/+10
| | | | | | | | | | | Blacklisting doesn't work when the tests crash, use the emulation detection instead and skip tests. Task-number: QTBUG-90869 Change-Id: Icd9cff8b9d45edc2f97ae13acdf0e71ed44aa0e4 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 77156cd98f3e29d9bd89df335bb172e59da43483) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MouseArea: fix containsMouse behavior during visibility changesVolker Hilsheimer2021-02-122-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItem returns whether it contains QGuiApplicationPrivate's lastCursorPosition. Since that position stores the coordinate last seen by Qt (the window border), it will always be within the window, and within an item that covers that part of the window's border. However, QQuickWindow stores the lastMousePosition as well, and resets that value when it receives a QEvent::Leave. We can use that to test whether the window that contains the item has seen a Leave event, in which case the item is definitely not under the mouse. Notes on the test: That we use QPointF() as the "reset" value leave the small possibility that the cursor might be at position 0,0 of the window (ie inside the window), and the QQuickItem there will not be under the mouse. We can't confirm this (through an expected failure test), as QTest::mouseMove interprets a QPoint(0, 0) as "center of the window". And since we can't simulate mouse moves outside a window's boundary using QTest::mouseMove, the test needs to explicitly synthesize a QEvent::Leave for the window. Fixes: QTBUG-87197 Change-Id: I04870d6e914092275d9d790312fc702fb99f2935 Done-with: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ba1246c543118515ea244787f3d7f9c1133ccf0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace QScopedPointer with std::unique_ptrVolker Hilsheimer2021-02-123-24/+24
| | | | | | | | | Fix compiler warning, QScopedPointer::take was deprecated in Qt 6.1. Change-Id: I67045bce97efb082b1b7467a6c24d5dbf996fdc1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 070072e7cabd6f4f26f4938b1616e56254ad25d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickitemlayer: skip tests when running on offscreen platformSamuli Piippo2021-02-051-12/+40
| | | | | | | | | | More tests fail on offscreen platform when tested on QEMU on CI. Task-number: QTBUG-63185 Change-Id: I293e9b32078bf2567fbb9773cedf6777ad182a69 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 34477bdbb00b351fe254fc42155e876d06b0c994) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickdesignersupport: blacklist tests that segfault on QEMUSamuli Piippo2021-02-051-0/+7
| | | | | | | | Task-number: QTBUG-90869 Change-Id: I70abb1baa2b919880bc711ee00d5fdbaef69301d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 1e8cb40d24402c9d0b6290cc251244ba0ec882d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make the internals of QQuickAnimatorController privateUlf Hermann2021-02-021-0/+4
| | | | | | | | | | No one should mess with those. All the pointers have complicated ownership semantics. We can just befriend the test instead of making it all public. Task-number: QTBUG-90401 Change-Id: I6c4adbab7046b40db7f4628780ef928445ea3eb2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Expose the list of preferred instance extensions to rendercontrol usersLaszlo Agocs2021-01-211-0/+2
| | | | | | | | | As all QRhi stuff is private, it needs to have a public counterpart in Qt Quick in order to fully support the case of Vulkan-based QQuickRenderControl usage. Change-Id: Iaf9a7aa56022acd31af6ebf16de6b83a04966ff4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* tst_qquickloader: Make message matching less stringentFabian Kosmale2021-01-201-1/+1
| | | | | | | | For some reason, we do not get the correct line number on macOs. Task-number: QTBUG-90448 Change-Id: I8dc45011c68e2cbe0d30f4a54f48a74a5a6b0271 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* QQmlComponentPrivate::setInitialProperties: Do not silently swallow exceptionsFabian Kosmale2021-01-183-1/+23
| | | | | | | Instead, log them with qmlWarning. Change-Id: Icde7397085841a84aca8a81c716d552c4cd4485a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update hovered on disabled QQuickItemsAllan Sandfeld Jensen2021-01-181-1/+1
| | | | | | | | | | | | | | | | Changes handling of hovered so that the property is still updated on disabled items, so that other items can bind to it. This is in particular useful for tooltips. [ChangeLog][Behavior Changes] QQuickItem::hovered will now update even when the item is disabled. Fixes: QTBUG-30801 Pick-to: 6.0 Change-Id: Id17298f657d7631b0e5019138ba33a7d5f863475 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-1590-1375/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Change QQuickShortcut::setSequences to bind to all sequencesAndreas Buhr2021-01-151-17/+106
| | | | | | | | | | | | | | | When binding a Shortcut to a standard key sequence like QKeySequence::FullScreen, it binds only to one key sequence, even though there might be multiple key sequences associated. This patch changes the code to emit a warning in this case and allows to bind to multiple key sequences using 'sequences: [ <key> ]'. Fixes: QTBUG-88682 Pick-to: 6.0 5.15 Change-Id: I88998aa8858d8f2c0c86e46bae94afd7ceb15b66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Flickable: ignore trackpad events with px deltas in disallowed directionShawn Rutledge2021-01-152-0/+113
| | | | | | | | | | | | | | | | If Flickable.flickDirection == HorizontalFlick, then if the accumulated QWheelEvent::pixelDelta()'s abs(dx) > 2 * abs(dy), clearly the user is trying to scroll horizontally; otherwise, don't accept the event. That way the event is allowed to propagate to a parent Flickable that does allow flicking vertically. Likewise if the nesting is the other way around, only allow the inner vertical Flickable to accept if the flicking is actually vertical. Fixes: QTBUG-57245 Fixes: QTBUG-80236 Pick-to: 6.0 Change-Id: Ieb0bf9310a67210ce7e9fe7a80c88baef2cc7ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QuickLayouts: fix crash when layout width depends on parent widthIvan Solovev2021-01-151-0/+37
| | | | | | | | | | | | | | | | | Some tricky cases of setting layout width based on parent layout width were leading to infinite recursive loop of layout size calculation (see the attached example in the related Jira task). Initially the QQuickGridLayoutBase::rearrange() method already had a recurse check, but it seemed to happen too late, so that the recursive calls kept happening from the ensureLayoutItemsUpdated() calls. This commit moves the recursion check up, so that it's actually executed before we have a chance to get to the next level of recursion. Pick-to: 5.15 6.0 Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Do not revert properties of deleted objectsAlexey Edelev2021-01-142-0/+116
| | | | | | | | | | If state contains revert action of properties of deleted objects, we should avoid adding them to apply list Fixes: QTBUG-85106 Pick-to: 5.15 Change-Id: Iff57eb9958a054476096f6d951ab7390277a2b39 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix Text with ElideRight not being rendered when width goes from 0 to >0Fabian Kosmale2021-01-142-0/+33
| | | | | | | | | | | | | | | | | | QQuickText attempts to reduce relayouting. However, it was a bit to aggressive in doing that. If only the width changed in a geometrychange, it would not relayout if widthMaximum was true. However, if the width goes from 0 to greater than 0, the value of widthMaximum should have actually been false (but we would only notice this after relayouting). Thus, don't skip relayouting in that case. Amends 56ade46b4234bb828b8e4f9a6bf83b5687bd122e, which fixed the same issue, but for height. Fixes: QTBUG-83408 Fixes: QTBUG-33608 Pick-to: 6.0 5.15 Change-Id: I14b610c703eb0496c71de7b12ad9fcf16842af64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix QQuickShortcut::setContext so re-grab all shortcutsAndreas Buhr2021-01-131-0/+44
| | | | | | | | | | | | A while ago, QQuickShortcut was extended to not only have a shortcut m_shortcut but in addition a list m_shortcuts. During this extension, the setContext method was missed: Shortcuts in m_shortcuts are not re-grabbed on context change. This patch fixes this. Task-number: QTBUG-88682 Pick-to: 6.0 5.15 Change-Id: Ie73d516f2a325a328b6e975d69490eea29a18401 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist failing tests for QEMU ARMv7Samuli Piippo2021-01-073-0/+12
| | | | | | | | | QEMU has a bug that prevents fontconfig to work correctly, which causes font related testcase to fail. Blacklist those when running them in CI. Task-number: QTQAINFRA-4127 Change-Id: Id6970be0db49128fb46838dbec04bc6f26048761 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Refactor QQuickTextInput test to use QKeyCombinationVolker Hilsheimer2020-12-101-75/+35
| | | | | | | | | | Makes the code typesafe, simplifies the data structures, and fixes a compiler warning from implicit conversion from/to int. Pick-to: 6.0 Fixes: QTBUG-89356 Change-Id: I52d834811fa7325788fc71ea20f78b4afe3fdb86 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-104-3/+9
| | | | | | | | | And fix up some incorrect qmake project files Pick-to: 6.0 Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Show a tableview even if the syncView has an empty modelAndy Shaw2020-12-091-0/+43
| | | | | | | | | | By showing the tableview, we can be sure that headerviews will be visible even in the syncView has an empty model. Fixes: QTBUG-87526 Change-Id: I68c8b119122a2d2f88c2afbeb2d6c71a83a3ce33 Pick-to: 5.15 6.0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Blacklist testTransitionsWithImplicitFrom on openSUSE againLiang Qi2020-12-081-1/+1
| | | | | | | | This amends f87c4c7c2a0866662143fdbb3060e7d6ccaf337c. Task-number: QTBUG-89023 Change-Id: I4d3e03df6071b4fbaef3d1c60605dc68ca37aaad Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* QML engine: Deprecate DefaultMethodFabian Kosmale2020-12-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | Assigning objects to signal handlers can be convenient, as seen in the examples which use it together with ListView.onRemove. However, that convenience makes it hard to reason about what actually happens. Moreover, the only user of that functionality are the Animation classes, and the usage of DefaultMethod is not documented anywhere. [ChangeLog][QtQml] Assigning an object to a signal handler is deprecated. Instead, create the object, give it an id, and call the desired slot from the signal handler. For instance, instead of of ListView.onRemove: SequentialAnimation {...} use SequentialAnimation {id: removeAnimation; ...} ListView.onRemove: removeAnimation.start() A warning will be printed whenever an assignment of an object to a signal handler occurs. The warning can be controlled via the qt.qml.defaultmethod logging category. Change-Id: I001ddf4d7933871977f84a5e012d020fb043cc64 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Un-blacklist tst_TouchMouse::hoverEnabledShawn Rutledge2020-12-011-3/+0
| | | | | | | Task-number: QTBUG-86729 Task-number: QTBUG-40856 Change-Id: I6936833236b584d9f91cca1583434fa9982ec569 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Blacklist testTransitionsWithImplicitFrom on openSUSELiang Qi2020-12-011-0/+1
| | | | | | Task-number: QTBUG-89023 Change-Id: I620d47ef6f519d59436fe096ccaa78216b23d98a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist testTransitionsWithImplicitFrom on Ubuntu 20.04Fabian Kosmale2020-12-011-0/+3
| | | | | | Task-number: QTBUG-89023 Change-Id: I76b3920de3cd933f573f1a800fe800a8d5413798 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Relax the timings on the new testTransitionWithImplicitFrom testRobert Griebl2020-11-301-6/+6
| | | | | Change-Id: Ie9fae8a7edb07c6df499a06fdc9d539e114b789e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow parent to filter out-of-bounds synth-mouse for grabbing handlerShawn Rutledge2020-11-305-40/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider Flickable { Text { TapHandler { gesturePolicy: TapHandler.ReleaseWithinBounds } } } On press, TapHandler gets the exclusive grab. Now drag vertically. The Text is short in stature, so your finger soon strays out of bounds of the Text, likely before you have dragged past the drag threshold. In this case, we want Flickable to continue to filter the move events because of the fact that TapHandler is the grabber. If it was a MouseArea instead of a TapHandler, it already worked that way; so this makes behavior of handlers more consistent with that. More specifically: QQuickPointerTouchEvent::touchEventForItem() now generates a touch event even if the touchpoint is not within the bounds of the given item, but is grabbed by one of that item's handlers. Until now, we had that exception only if it was grabbed by the item itself. tst_FlickableInterop::touchAndDragHandlerOnFlickable now always drags the delegate at index 2 (the third one) from its upper-right corner, upwards and to the left. The first drag goes outside the delegate's bounds, but the Flickable/ListView/TableView filters and takes over anyway (on the next drag), to prove that it is correctly depending on the grab that the TapHandler (or DragHandler) took on press. Pick-to: 5.15 Pick-to: 6.0 Fixes: QTBUG-75223 Change-Id: Ie4e22c87be0af9aa3ff0146067b7705949b15c40 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Speed up tst_FlickableInterop::touchAndDragHandlerOnFlickableShawn Rutledge2020-11-296-0/+54
| | | | | Change-Id: I9d01dc00c68979aa9288820fddaaa7b0208bec9b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix Animators requiring an explicit from valueRobert Griebl2020-11-284-4/+142
| | | | | | | | | | | | | | | | | | | Contrary to the documentation, Animators have always had the requirement that an explicit from value was specified, which isn't very convenient e.g. in Transitions. This patch was tested against a (quite big) real world customer application using Qt 5.12 and Qt 5.15. Also a new unit test was added to test this feature. I couldn't find another way to access the actual AnimatorJob besides querying the window's AnimatorController, so I had to add an auto-test only export on that class. Task-number: QTBUG-66475 Pick-to: 6.0 6.0.0 Change-Id: Icc2a220a13f587d69594a4b2ed345abf0438e29e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Modernize the Animators auto test buildRobert Griebl2020-11-282-10/+12
| | | | | | | | | The pro file was adapted to the state of the qquickanimations one and the cmake part regenerated. Pick-to: 6.0 6.0.0 Change-Id: I5dbc2c985a84019e42c974468db4b8dc0fa3d210 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Correct height properties for QQuickText with reducing lineHeightReinhard Raschbauer2020-11-261-2/+16
| | | | | | | | | | | | | | | If the property lineHeight is used to reduce the line height, either by setting a proportional factor smaller 1.0 or a pixel size smaller than the font size, the offset calculated in lineHeightOffset is not taken in to account to calculate the height properties. But the offset is used to position the the rendered text. In the current implementation the property lineHeight does not have an effect on single line texts. This change takes that into account and adds lineHeightOffset to all height properties. Fixes: QTBUG-88229 Change-Id: Iab7d9b39a4c7876c7c95e43be6846623c10b0607 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Purge renderpass refs from renderer when redirecting via QRhiRtLaszlo Agocs2020-11-241-1/+32
| | | | | | | | Pick-to: 6.0 Fixes: QTBUG-88761 Change-Id: Ia5df65a4a09a7554a7d0cca4533f766cb5abe97b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Attempt to stabilize tst_QQuickListView::sectionsSnapShawn Rutledge2020-11-242-4/+2
| | | | | | | | | | It only failed due to being in a "bad" sequence with other tests somehow. Fixing by reordering is lame, but I can't find the actual reason that it fails, so far. Task-number: QTBUG-86729 Change-Id: I8450c2e4b3119326c8518a526801cd10e933dca0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix qmake build of tst_qquickview_extraAndrei Golubev2020-11-242-0/+4
| | | | | | | | | | While dev/6.0 uses CMake as a main build system, just in case we will run qmake tests in CI, make sure it works Leftover of 3a5617dc45e281552b9c1f7a04f0561b8fa14d94 Pick-to: 6.0 Change-Id: I32efba9140206f0dfb2e8458fe5c6a2d4d51dbc7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't deliver to non-grabbing pointerhandlers if a point is grabbedShawn Rutledge2020-11-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, on press when QQuickFlickable::filterPointerEvent() calls captureDelayedPress() and will return true, it also accepts the event to stop propagation. It becomes the grabber as a consequence of that. On a future move event, when the drag threshold is exceeded while the delayed press timer is still running, Flickable already has the grab (but it accepts the event again), and QQuickFlickablePrivate::drag() calls setKeepMouseGrab(true). In this case we still want to prevent any children's DragHandlers from seeing the event, because a DragHandler will also see that the drag threshold was exceeded and try to steal the grab. A DragHandler can steal the grab only if there was no press delay: then it sees the initial press because Flickable does NOT stop event propagation (does not accept the event), so it can take a passive grab and continue to wait for the drag threshold to be exceeded, regardless of what else happens. In case of multiple touchpoints, allPointsGrabbed() returns false if the Flickable has only grabbed one point; but we want to avoid delivering handlers in children just on the basis of that grabbed touchpoint being within their bounds, even though other points may be delivered to various handlers. This fixes tst_FlickableInterop::touchAndDragHandlerOnFlickable. The blacklisting of dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch was bogus (it's in the mousearea_interop test). Pick-to: 6.0 Task-number: QTBUG-86729 Change-Id: I9f0d42e97de4f4a3b4f7773800a8d59dc34a0553 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix QML property cache leaks of delegate itemsAndrei Golubev2020-11-235-0/+156
| | | | | | | | | | | | | | | | | | | | | The delegate items are destroyed through an event loop by a call to a deleteLater(). This, however, doesn't work when the application is in the process of exiting and the event loop is already closed (i.e. we're in a stack unwinding part that starts after app.exec()) Combat this situation by setting a parent of the to-be-deleted object to some QObject that will be destroyed e.g. QCoreApplication::instance() before the program finishes. As QObjects clean their children on destruction, this will make sure that we cleanup the previously leaking thing regardless of the event loop Added a test to check that delegates are destroyed (as a separate binary due to differences in main() function) Fixes: QTBUG-87228 Pick-to: 6.0 5.15 Change-Id: I59066603b77497fe4fd8d051798c3e4b47c119f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix multipointtoucharea_interop testsShawn Rutledge2020-11-232-19/+15
| | | | | | | | | | | | | | | | | | | | | | In several places these were doing stuff like touch.press(1, p1).commit(); QTRY_VERIFY(devPriv->pointById(0)->passiveGrabbers.contains(drag)); The point ID is really the key in activePoints, it doesn't necessarily start from 0; so pointById() has to be given the same point ID that was used in the event, otherwise it will construct a new point(0). But now tst_MptaInterop::touchesThenPinch fails further down: after the complicated series of events, when only one point is still being dragged, DragHandler fails to grab it and start dragging for some reason. dragHandlerInParentStealingGrabFromItem() uses mouse not touch. Pick-to: 6.0 Task-number: QTBUG-86729 Change-Id: I7ad0d3f30cb5fee15fe83183d62ee10a020c14df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tst_TapHandler::componentUserBehavioralOverrideShawn Rutledge2020-11-232-4/+2
| | | | | | | | | | | | | The QQuickPointerHandler::grabChanged() signal now has QEventPoint by value rather than by pointer (because it's a value type, whereas in Qt 5 it was a QObject). Amends a97759a336c597327cb82eebc9f45c793aec32c9 Pick-to: 6.0 Task-number: QTBUG-86729 Change-Id: I5514dc1b49a0b47276c41264e18f6a541bc2a3f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix tst_PointHandler::pressedMultipleButtonsShawn Rutledge2020-11-232-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | QQuickWindowPrivate::deliverPressOrReleaseEvent() calls QPointerEvent::clearPassiveGrabbers() for every QEventPoint that has the Pressed state. This is consistent with the idea that for every press (a different mouse button or a different touchpoint), we start over with event delivery so that different items and handlers can see what's going on and decide whether it's relevant for them. But QQuickPointerHandler::onGrabChanged() reacts with setActive(false). So for example if we press left mouse button, then keep holding it and press right mouse button, PointHandler changes its active state twice, because its passive grab was cleared and then we visit it again; it's still interested in tracking the mouse, so it takes another passive grab and becomes active again. Avoiding emitting activeStateChanged in this case would seem a bit contrived. As long as the release of one button doesn't make PointHandler completely lose interest prematurely, QTBUG-66360 can still be considered fixed, I think. Pick-to: 6.0 Task-number: QTBUG-66360 Task-number: QTBUG-86729 Change-Id: I132a8c5d1878769481b8afcc62ba237b4498b069 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix compiler warningsVolker Hilsheimer2020-11-231-15/+15
| | | | | | | | | | The bit flags in QAccessible::State are unsigned, numeric literals are signed, resulting in compiler warnings when comparing. Instead of QCOMPARE'ing bitflags that are used for booleans, use QVERIFY. Pick-to: 6.0 Change-Id: I9fd6906a8c1c1e356f8e6c5b36d40f6c41590ee8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_qquicktextinput: Do not construct illegal QCharFabian Kosmale2020-11-231-4/+17
| | | | | | | | | | | This change does the minimal amount of work to get the test to run without crashing due to triggering a QChar assert. Note that Key::toString does not check whether the QChar value it tries to construct is actually valid; but all values in the test case are. Fixes: QTBUG-88712 Change-Id: Ie484e66de46ad1d78573c31d90d40c99b8fd7caa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up and un-blacklist tst_QQuickMouseArea testsShawn Rutledge2020-11-202-436/+251
| | | | | | | | | | | | | | | | - Use QQuickTest::showView() consistently to reduce boilerplate - Use QTest::mouse*() where possible rather than constructing QMouseEvents (and potentially getting them wrong) - Use QPointingDevicePrivate::firstPointExclusiveGrabber() on a specific device to check grab state rather than QQWindow::mouseGrabberItem() - The warning "event went missing during delivery!" has been removed, so tst_QQuickMouseArea::nestedEventDelivery() shouldn't expect it Pick-to: 6.0 Pick-to: 6.0.0 Task-number: QTBUG-86729 Change-Id: Ieb1af38c118dadf8cdf8ae19f92002207d71d5b5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Un-blacklist tests that grafana says are passingShawn Rutledge2020-11-202-6/+0
| | | | | | | | | | | canvas::test_implicitlySizedParent tst_qquicktext::dependentImplicitSizes Task-number: QTBUG-41043 Task-number: QTBUG-75786 Task-number: QTBUG-76608 Change-Id: Id90669e58eac4cbe1a3b73406641a8e42f9523b1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tests: blacklist tst_QQuickGridView::snapToRow() and snapOneRow() on MSVCLiang Qi2020-11-201-0/+3
| | | | | | Task-number: QTBUG-88644 Change-Id: I363763788b53b0722f680599c08e17d0cb40fcac Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* tests: blacklist tst_qquicktext::contentSize() on MSVCLiang Qi2020-11-201-0/+1
| | | | | | Task-number: QTBUG-88646 Change-Id: Ia37fc8c4f5c0e56eeaef4f8f82974ee749dd74fc Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>