aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Extend blacklisting of tst_QQmlImport::importPathOrder to MinGWTony Sarajärvi2021-01-251-0/+1
| | | | | | | Task-number: QTBUG-88643 Change-Id: I51d346c127e3269eca49e387db578c16480a0565 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 93c791eaf39f2ed198c7dc188b8257b638b61465)
* tests: blacklist tst_QQuickGridView::snapToRow() and snapOneRow() on MSVCLiang Qi2021-01-251-0/+3
| | | | | | | | Task-number: QTBUG-88644 Change-Id: I363763788b53b0722f680599c08e17d0cb40fcac Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> (cherry picked from commit 19226ef1f1df0375395d832e07ee7655cb0dd83d) Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: blacklist tst_qquicktext::contentSize() on MSVCLiang Qi2021-01-251-0/+1
| | | | | | | | Task-number: QTBUG-88646 Change-Id: Ia37fc8c4f5c0e56eeaef4f8f82974ee749dd74fc Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> (cherry picked from commit 1ddc6b5216c48a078a03653697ad6fec99ec9ce4) Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: blacklist tst_QQmlImport::importPathOrder() on MSVCLiang Qi2021-01-251-0/+2
| | | | | | | | | Task-number: QTBUG-88643 Change-Id: I4614e46e9740769660f6c068ed1ff0407378b66b Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit fe2d3a839775f64f7aad8610ea241c8760be4646) Reviewed-by: Liang Qi <liang.qi@qt.io>
* qmllint: Fix auto-importing of qmltypes from same directoryUlf Hermann2021-01-223-0/+27
| | | | | | | Fixes: QTBUG-90513 Change-Id: Ic39e72d6df20be30c61123a7f8091d70dbc2d924 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9b407b68d1fc0abe08091aa7ca007fbf0f03fb89)
* 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 Change-Id: I88998aa8858d8f2c0c86e46bae94afd7ceb15b66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6511b17038627ac30cb6622b13c7d46d9877bac5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlComponent: Avoid crash when setting initial properties in JS moduleFabian Kosmale2021-01-154-0/+31
| | | | | | | | | | | In a JS module, we lack a qml context. Thus, we have to check whether qmlContext is null. In that case we use the engine's scriptContext('s ExecutionContext) instead. Fixes: QTBUG-90245 Change-Id: I337e9c7cade472f52fc81c93d1152ff59f8018a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e68b498424f63c1cb6151e4fc6bbc50bac584909)
* 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. Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 4f8041b01445fd4eec0beb133719645d00d0b2ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: Ieb0bf9310a67210ce7e9fe7a80c88baef2cc7ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dccd8f0b5ca8f6faefb49718e33f9090243f3202) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I14b610c703eb0496c71de7b12ad9fcf16842af64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 127c79fb7fda16b9a48ce8c425d1700d1aa7502d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: Ie73d516f2a325a328b6e975d69490eea29a18401 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 28f515e6334fd1c15a2f7f18de6be7bfe1f9c302) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ListModel: Fix move handling in syncFabian Kosmale2021-01-135-0/+361
| | | | | | | | | | | | | | | | | When a ListModel is modified in a workerscript, we reconciliate the state in ListModel::sync. However, the logic for moving elements was wrong, causing crashes in endMoveRows due to invalid moves. This patch ensures that elements are moved to the correct position. Notably, whenever an element is moved, we must update the targetIndex of all elements affected by that move. Amends 3accc1dae76575120e71cadb547e961ecd50bcb0. Task-number: QTBUG-85557 Change-Id: I1a1ffa43eab39ed2315f1916527d897b208c2c3b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 2996439993c587bc9c7169e4f152169f28247c21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add Lancelot tests for both types of clippingLaszlo Agocs2021-01-123-0/+99
| | | | | | | | | | | Scissor-based clipping is exercised by existing tests, the stencil-based one however is likely not. Add a simple test case for both. Task-number: QTBUG-89898 Change-Id: I6cba2e30542fba074ee052782170e150ae2f074a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit e3cca3df718d8ff298d2d73ce4d6139a3ba620f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct #if-ery in QML locale's time-zone update testEdward Welbourne2021-01-081-7/+11
| | | | | | | | | | | | The feature check for timezone should apply to the whole test; it makes no sense without. The checks against Q_OS_WIN were redundant in code already subject to a Q_OS_UNIX check. Task-number: QTBUG-89889 Change-Id: I419a775bf0777379662aa19e5b0c81fd6e0e26f6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 338ae625a350d1e471a4033f1bcc6e1bfa9c1690) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qqmlenginecleanup::test_customModuleCleanup(): Add error outputFriedemann Kleint2021-01-041-2/+10
| | | | | | | | | | The test fails for MinGW in the CI for unknown reasons. Output the error string on failure. Change-Id: I96415c9d5753f9013be22b55884175fda6604130 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cffae9109eecc838a5b107cc58f43637a3c3279e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation warning in lancelot testEirik Aavitsland2020-12-281-1/+1
| | | | | | | | | Use new qChecksum overload Change-Id: Ia2990e3491ee0c4029bba8e645109b03ac5001db Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 5aec31639c503bfe00249c65a13d0f34f93edcc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist qqmlenginecleanup::test_customModuleCleanup() for MinGWFriedemann Kleint2020-12-231-0/+2
| | | | | | | | | The test fails for MinGW in the CI for unknown reasons. Change-Id: I20199704a9c810499551b8952375926902a75aa0 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commit 3c049c7a996d156c2faf9a257e209fe8b23d1151) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ecmascript tests: Also raise timeout when built with cmakeUlf Hermann2020-12-181-0/+4
| | | | | | | | | | | pro2cmake did not convert the QTEST_FUNCTION_TIMEOUT environment variable. As a result, when the test runs for more than 300s, it gets killed by the watchdog. Change-Id: I370d2c1b7a129c41d690d41e84f0a51810d37160 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d5ac54da624dbaebc865c8243a5e1c33d5e1c7ba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Fix proxy iterationFabian Kosmale2020-12-172-0/+39
| | | | | | | | | | | | If the target of a proxy was extensible, we did not set the iteratorTarget to its correct value, and thus the ForInIteratorObject would not be usable. Fixes: QTBUG-86323 Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows/MinGW: Fix qqmltimer warnings floodFriedemann Kleint2020-12-171-19/+6
| | | | | | | | | | | | | | | | | | | Replace the dubious function eventLoopWait() by QThread::msleep() since it causes a warnings flood when using MinGW: tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) tst_qqmltimer::stopWhenEventPosted() QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.) Change-Id: I161d1d025f79560b21aaaeb510e4956eba54bdea Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d9a6c45a06f23cdd896e5360cc3cd3608fea4c3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlformat: Remove import sortingMaximilian Goldstein2020-12-165-300/+36
| | | | | | | | | | | Remove import sorting due to the fact that sorting imports can break code. [ChangeLog][QML Tooling][qmlformat] Remove import sorting and the (now obsolete) -n parameter to disable it Fixes: QTBUG-89295 Change-Id: I5ff13d0ae3c715db7645b412152aadb31811ce5a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cf3e0559b01b249a6ec06f8826e8e05aca1301ec)
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-108-4/+184
| | | | | | | | | | And fix up some incorrect qmake project files Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c1c4a874e31ba108a3600fbbb0aee7fc0bf34601) Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Refactor QQuickTextInput test to use QKeyCombinationVolker Hilsheimer2020-12-101-64/+37
| | | | | | | | | | | Makes the code typesafe, simplifies the data structures, and fixes a compiler warning from implicit conversion from/to int. Fixes: QTBUG-89356 Change-Id: I52d834811fa7325788fc71ea20f78b4afe3fdb86 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 8257cf75c68bd3d2a2af0cd8260e3cc96f5d0df4) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qqmltypeloader: Fix plugin not loading on MinGWMaximilian Goldstein2020-12-101-1/+1
| | | | | | | | | | | | Usually libraries get a lib prefix when using MinGW but plugins are expected to not have a prefix, causing the plugin to not load properly. This change fixes this by using the MODULE keyword. Fixes: QTBUG-89187 Change-Id: Icd543015805a8157d59c20e86134421911930ea1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 323cdf820c723660f3c67c3fd583f0b28c8d80a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 27c254203b3e7dd6d3a4445feb205fbe98c32d30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qqmlecmascript: Avoid memory leak on failureFabian Kosmale2020-12-031-3/+2
| | | | | | | Change-Id: Icf31fbe473e5b0659cfe09d5bef8652c22a2b1ce Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 355ff606853d885b9ad7c6e1549c3f25bfa48a2c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML engine: Fix binding setupFabian Kosmale2020-12-034-0/+33
| | | | | | | | | | | | We set QProperty bindings up in the wrong way: Parent components would overwrite their child component's binding. This patch reverses the order, fixing the bug. Task-number: QTBUG-87153 Change-Id: I3e90d1d14a41a7c5c337745f1453484d360a3979 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 96e321bc5cf3c1a6d52374a6f4070a438032b08d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Fixes: QTBUG-75223 Change-Id: Ie4e22c87be0af9aa3ff0146067b7705949b15c40 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1e1674849a89db54cdbcc4e995300e3ec1624c3a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adjust toolsupport test to qtbase changeFabian Kosmale2020-11-301-1/+1
| | | | | | | Change-Id: Id12b484634d66d3f46c7905e233beb6cd5897979 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 468888cf08c181366df94627522b9e282d364b81) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve stability of animated lancelot test sceneEirik Aavitsland2020-11-261-1/+1
| | | | | | | | | | The lancelot test has shown sensitivity to timing on some platforms; this change improves stability there. Change-Id: I9c8519423635fc22724d96e0a09bcdd1dd0a0102 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 473ce18934d067dd3fcfd5ac4c1e8d54235497c5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash when calling hasOwnProperty() on proxy objectRichard Weickelt2020-11-241-1/+30
| | | | | | | | | | | | Property pointer p needs to be checked for nullptr value in QV4::ProxyObject::virtualGetOwnProperty(). This can happen when calling hasOwnProperty() or propertyIsEnumerable(). Fixes: QTBUG-88786 Change-Id: I43da58fed4d8656f9187213f7317f17398739e34 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 9b321a34490cd17c0eb043b69bd7c9d8d8f513d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Purge renderpass refs from renderer when redirecting via QRhiRtLaszlo Agocs2020-11-241-1/+32
| | | | | | | | | Fixes: QTBUG-88761 Change-Id: Ia5df65a4a09a7554a7d0cca4533f766cb5abe97b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit bbb6298204b95f049c8a177365125247ba49dba3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I32efba9140206f0dfb2e8458fe5c6a2d4d51dbc7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fc4d721e5fdeeced3ab1ca0eb6803c58a22a8763) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QML property cache leaks of delegate itemsAndrei Golubev2020-11-245-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 Change-Id: I59066603b77497fe4fd8d051798c3e4b47c119f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3a5617dc45e281552b9c1f7a04f0561b8fa14d94) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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). 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> (cherry picked from commit c5c05498a7e79c1868551192921a42236ecbf5f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Task-number: QTBUG-86729 Change-Id: I5514dc1b49a0b47276c41264e18f6a541bc2a3f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e94eeb48b5a7f6a53ff9e48ffc216113852bccf4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Task-number: QTBUG-66360 Task-number: QTBUG-86729 Change-Id: I132a8c5d1878769481b8afcc62ba237b4498b069 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d15f6e0b237107d176a9790da609ff72ce3111f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Task-number: QTBUG-86729 Change-Id: I7ad0d3f30cb5fee15fe83183d62ee10a020c14df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d0733d14063bbe62082b581599e78e312d3008be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: I9fd6906a8c1c1e356f8e6c5b36d40f6c41590ee8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 22e13d41b0e8085b25b669eb7d23744252f2c117) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqml.h: Add QML_IMPLEMENTS_INTERFACESMaximilian Goldstein2020-11-232-15/+4
| | | | | | | | | | | Needed in order to allow for the declarative registration of classes implementing interfaces. Fixes: QTBUG-88623 Change-Id: Id9c1ae92774dd9c316ceaa737cb48ef28f56545c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 87533900738d65ad278722b292852c998e987c10) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML Text doesn't reset lineCount when text is emptyShinichi Okada2020-11-231-0/+37
| | | | | | | | | | | | lineCount is not reset when replacing a multi-line QML Text 'text' property with an "" empty string. Also, the lineCountChanged signal is not emitted Task-number: QTBUG-84458 Change-Id: Ic3c02e6a90e6675eadbaafc6af6ab0356ee98123 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ae1b9c6d94001411efeef600e22638906e0fa990) Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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 Task-number: QTBUG-86729 Change-Id: Ieb1af38c118dadf8cdf8ae19f92002207d71d5b5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f1a9c9b4273ec6104a0543b5cf48281141f613e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_QQuickMouseArea::notPressedAfterStolenGrab againShawn Rutledge2020-11-193-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Most of the time, QQuickWindowPrivate::deliverMatchingPointsToItem() doesn't need to call item->mouseUngrabEvent() because all grab changes are notified via the connection from signal QPointingDevice::grabChanged to slot QQuickWindowPrivate::onGrabChanged(). But in this case, MouseArea only accepts the event, rather than taking the grab itself. Therefore at the time the grab is "stolen", there was not yet any grabber, because grabbing is done after delivery. But we still need to inform MouseArea that it's not getting the grab it expects to get, so that it can reset its pressed state. But we don't want it to be redundant (other tests are counting events, and we don't want repeated ungrabs to show up in those); so now we have to track whether the item on which we're about to call mouseUngrabEvent() has already gotten it. This illustrates another problem with the tradition of accepting events and being unclear about what it means. Grabbing is one thing, ending delivery is another. Amends a97759a336c597327cb82eebc9f45c793aec32c9 Task-number: QTBUG-55325 Task-number: QTBUG-86729 Change-Id: I8150f901e00e7a71499fc98ab54f0ba75370f3ec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Conditionally disable tests that depend on cxx11_future flagTony Sarajärvi2020-11-191-0/+2
| | | | | | | Task-number: QTBUG-88650 Change-Id: I2cac1b8ca7ec8ed8401206cf761244b3f483ca14 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Stop ungrabbing due to FocusAboutToChangeShawn Rutledge2020-11-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to un-blacklist the test for QTBUG-60123. To that end: revert 7b2e2117162594a2d0234bb02408f5b5a446488b and its followup 6933b7e8e6dc279a8eb34e1f4c60bc109dfb7d26. There is no detailed bug report explaining exactly why those were done, just the comment on code review: "This fixes the desktop components' combo box on linux re-opening at random times", probably referring to a combobox popup window in Controls 1. But when using QWidget::createWindowContainer() in two different windows and clicking MouseAreas in each of them, it turns out that this change of focus is causing the mouse grab to be canceled. The grab should be naturally given up after mouse release; canceling prematurely doesn't make sense. The Qt 5 fix for this bug was e0c30279ec1fad88346ed3fb483bc3c672fdd01b which tracked the grab on a per-window basis. It would be difficult to do that again now (change QPointingDevicePrivate::setExclusiveGrabber() to store a separate grabber for each window in which a grab occurred? what could go wrong...) It seems odd to have the same QEventPoint grabbed in two different windows at the same time, but popups need event forwarding so maybe that was why (if a MouseArea triggers the popup, should it stay pressed and keep its grab? the subsequent mouse moves and the release need to be forwarded to the popup, so maybe something inside the popup needs a grab, simultaneously or not). Anyway we don't have actual popup windows in Controls 2 right now; and we know that event forwarding for popups needs work in QtGui so that it will be easier when we try again to have them in Qt Quick (QTBUG-68080). So perhaps the original workaround has outlived its usefulness: popup event forwarding needs to be handled at the lower layer, not in Qt Quick. Task-number: QTBUG-57253 Task-number: QTBUG-60123 Task-number: QTBUG-86729 Change-Id: I56dbc3bb94f66a7f26f79a97bcb2f2bbc0b7aa92 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* tst_ma::pressedCanceledOnWindowDeactivate: don't pop up second windowShawn Rutledge2020-11-182-13/+2
| | | | | | | | | | | | | | I guess I must have thought it would be more realistic that way; but sending an explicit WindowDeactivate as we had it in early Qt 5 seems to keep the test passing now, and is probably more reliable. The original purpose of the test seems to be to verify the recursive delivery to all items via virtual QQuickItem::windowDeactivateEvent(), which MouseArea (and no other item!) overrides to ungrab the mouse. This mostly reverts commit 1c451b40aee66a38ca3d61e5beec4ae8c986c8ed. Change-Id: I0c6f953514095a491120a0aac9944dc8b04ca17d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tst_qqmlproperty: Fix interfaceBinding crash on MSVC 2019Maximilian Goldstein2020-11-182-8/+25
| | | | | | | Change-Id: I4bb4a66b7ccca838e058962bbc297659b273c78e Done-with: Fabian Kosmale <fabian.kosmale@qt.io> Fixes: QTBUG-84416 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use metatype and remove unused variableDavid Skoland2020-11-183-4/+2
| | | | | Change-Id: I709c6a74dc6a3eb0cdd3e94168921274f90df4a4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qmllint: Be more verbose when qmllint crashesUlf Hermann2020-11-171-0/+8
| | | | | | | Output the command line, exit status, exit code, stderr and stdout. Change-Id: I81a813bc44b7caf4c25d9097e8fbcbc3295ac6ec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix tests that used out-of-context mouse grabsShawn Rutledge2020-11-173-9/+8
| | | | | | | | | | QQuickItem::grabMouse() is deprecated, and cannot be used at all when there is no current event being delivered. But we can still use QPointingDevicePrivate::setExclusiveGrabber(). Task-number: QTBUG-86729 Change-Id: I215de471e6dc44551720bc4c766b22cdfee94423 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>