aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
Commit message (Collapse)AuthorAgeFilesLines
* Flickable: don't react to any mouse button other than the leftShawn Rutledge2021-09-282-0/+65
| | | | | | | | | | | In case of mouse "chording", ignore all other buttons. Fixes: QTBUG-96909 Change-Id: Ib091b271390c5b4e3aafbbe24d2dc7b6f08db175 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f91aa3b4d8ae7bfba65a8252099ded3b428f7acf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: Clear pre-edit text after input method resetJarkko Koivikko2021-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The QPlatformInputContext::reset() function does not allow any further input method events to be called. Therefore, clearing the pre-edit text is the sole responsibility of the text input control. This change modifies the QQuickTextInputPrivate::resetInputMethod() function and calls QQuickTextInputPrivate::cancelPreedit() instead of QInputMethod::reset() directly. The cancelPreedit() function will send a QInputMethodEvent which clears the IM state (in addition of calling QInputMethod::reset() function). Also, rename the QQuickTextInputPrivate::resetInputMethod() function to cancelInput, since it does not call inputMethod()->reset() directly. Fixes: QTBUG-95461 Change-Id: I6ab3b9dbe71956af72656e2a25a05d79603b34ea Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> (cherry picked from commit b2103e33f490c96d0068d211c6f2d5b540ca407e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix regression in ListView/Flickable event deliveryJan Arve Sæther2021-08-202-0/+212
| | | | | | | | | | | | | | | | | | The regression was introduced with 2acb31641fc9c34d24ac29232cdfec The problem was that when we entered QQuickListViewPrivate::wantsPointerEvent(), the event was not localized to the QQuickFlickable when mouse filtering was done. Therefore, since the code assumed that the localPos was local to the Flickable, it always ended up assuming that the point was within the bounds of the header/footer. Fixes: QTBUG-89409 Change-Id: Ib595e61b7995241b58e3051da09139e1e1f13cba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit b2e4f09bfa2c42af562f6741c0a0246a53028f0a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pass the focus reason through to the control on mouse pressVolker Hilsheimer2021-07-232-0/+119
| | | | | | | | | | | | | | | | | | Otherwise, a TextInput item will always receive OtherFocusReason when clicking into it. Add a test that simulates focus changes with mouse and keys, records the incoming focus events and verifies the correct focus reason is set in the event. Qt Quick provides no mechanism to access the focus reason from within QML (onActiveFocusChange only has a bool parameter, the focusReason property exists only in QtQuickControl). Task-number: QTBUG-75862 Change-Id: Ifea95c7ef2ac88c6c8e8bbdc8d2dbe5205ff922e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit bbcbb7c78f2f07e6c5e380ec5c018ac2a7abf292) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid infinite loop in designer supportThomas Hartmann2021-07-223-0/+68
| | | | | | | | Task-number: QTBUG-94928 Change-Id: I1ee14600fb0fd9f0ee499546e3ffcd66114aaeff Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> (cherry picked from commit d3cae36550fe8b82c641cef6a207e991a9064d85) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make tst_examples target uniqueKai Köhne2021-07-161-1/+1
| | | | | | | | | | | qtdoc has also a target tst_examples, which conflicts in a top-level build with examples. Change-Id: I95bd9b569089a6fd27db18784ecea02acd0831f7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2ecab24d46032ceb7705d2d0e4cebe9a9956d2d7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* When setting the line dash to be an empty array reset the style to SolidAndy Shaw2021-07-141-0/+31
| | | | | | | | | | | | An empty line dash array is indicating that it should be reset to be a Solid line, otherwise it ends up reusing the previous settings for the pen instead of drawing a solid line. Fixes: QTBUG-75553 Change-Id: I16466672de95da8ef0cf3fc261969e7cc6add227 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit c31638f16b1fe709dd9df232afb9ab7fac3b231e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TextEdit: ignore all key release eventsVolker Hilsheimer2021-07-142-0/+74
| | | | | | | | | | | | | | | | | Input events are accepted by default, and get ignored by the default event handler implementations. By overriding an event handler, the events get accepted, unless ignored explicitly. Since QQuickTextControl does not handle any key release events, it should explicitly ignore all of them, not just Key_Back (ignoring of which was added in 798112b6532a3c66abff630327d29a980a525f25). Fixes: QTBUG-95073 Change-Id: I09105fd8ebef73c03eb2083149643d188a2f1360 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6ca31ca88a7ee86308e329afd6cd2c90a050d4d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Send hover events with correct scene and global positionsShawn Rutledge2021-07-061-4/+38
| | | | | | | Task-number: QTBUG-94971 Change-Id: I047223dfdb76a6f1237b9d15b54381cd085aa1ac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0a271b5cd4da9e13accbf63a576413c45f367adc)
* Don't let PointerHandler steal mouse grab from keepMouseGrab layerShawn Rutledge2021-06-012-0/+88
| | | | | | | | | | | | | | | As explained in the comment, the handler can override the keepMouseGrab "veto" if the item is a parent (like a Flickable) that filters events, but not in other cases. The logic was wrong though, apparently. Amends 090f404cf80da35734f712b02cc1543acecd5b62 Fixes: QTBUG-78258 Task-number: QTBUG-79163 Change-Id: I9a473ab3b23743f863cb0be13767fdbc29cd5e1c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit b09ce7dcd8ecf24ef23da8197a64e3fced3fc894)
* Keep DragHandler active while dragging even if other event happensFabian Kosmale2021-05-272-0/+105
| | | | | | | | | | | | | | | | | QQuickPointerHandler::handlePointerEvent() calls setActive(false) when wantsPointerEvent() returns false (except for a NativeGesture event), for the sake of deactivating reliably when it receives an event which it does not handle. Now we need one more exception, because it's not what we want in DragHandler while dragging: If we get a wheel event, that should not interrupt the current drag operation. Thus, we change the logic in wantsPointerEvent to consider even events we wouldn't normally handle while the DragHandler is active. In handlePointerEventImpl, we then simply ignore them. Fixes: QTBUG-91549 Change-Id: I24e8bd890a21b244c9964f4df76986688085fa87 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 40bbf1e8fddebb0974426a03b0f48dfc08f942de)
* Emit grabChanged() from DragHandler and PinchHandlerShawn Rutledge2021-05-271-0/+4
| | | | | | | | | | | | Followup to ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 : when overriding a virtual function, it's good practice to call the base class function, in the absence of any reason not to. Fixes: QTBUG-93880 Change-Id: Icbd04faec51d55d8fbf73319bd20f5846761d3d5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a10eeee97d42f05409074f69cc99d9a8da5db077) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* mingw: Skip segfaulting testsOliver Wolff2021-05-251-0/+15
| | | | | | | | | | | | | | QQuickDesignerSupportProperties::registerCustomData segfaults on mingw. Due to these segfaulting tests, mingw is marked insignificant at the moment. In order to get at least some test coverage for this configuration, the tests are skipped for now. Task-number: QTBUG-90869 Change-Id: I75c61b83c53e038be4dc518bf39955f477d381ee Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9184f6c1de2c315cc66eb6cd3886c3daea90516f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist tst_QQuickGridView::snapOneRow for Win 10 MinGW developer buildHeikki Halmet2021-05-141-0/+1
| | | | | | | | Task-number: QTBUG-88644 Change-Id: I0fdaa7d8d527dcb4c22c54e7d1004ee02c5e241c Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commit f3ed98bf09885795de160468fd615c9e07d5ed5d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Map window coordinates to the same coordinate system as the QPointerEvent pointAlexey Edelev2021-05-112-3/+91
| | | | | | | | | | | | If the window has parent windows its geometry should be mapped to the global coordinates before check if it contains the point coordinates. Fixes: QTBUG-91716 Change-Id: I300547361dbe895b67caeee0d47f416426444552 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit c740a9d30571079fa22fd26cb8e72df6ca28c7b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist tst_QQuickGridView::snapToRow for Win 10 MinGW Developer buildHeikki Halmet2021-05-111-0/+1
| | | | | | | | Task-number: QTBUG-88644 Change-Id: I6ee6e443f68d628a28cc0101670dac86721d58cf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 0a51e25816a018d274c9f5f47e283ffc2e15604a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktableview: upon forceLayout(), check for visible rows/columns at the ↵Richard Moe Gustavsen2021-05-061-0/+78
| | | | | | | | | | | | | | | | | | | | | | origin There is a bug in TableView which will stop the user from scrolling/flicking back to the first column if it has become visible after first being hidden. The reason is that this is somewhat of a special case that happens only if the current left column is already at the origin of the viewport, since that will fool tableview into thinking that there can be no more columns in front of it. This patch add an extra section to the function that checks for visibility changes, to detect this special case. Fixes: QTBUG-93264 Change-Id: Ieaad507b45ea11dc231519e9f49cbf182d6443ba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 546df684e272bbbc5e8b871ae9b224fdb34a4cfa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DragHandler: don't try to handle native gesture eventsShawn Rutledge2021-05-052-20/+94
| | | | | | | | | | | | | | | | | | | | | No gesture handling has been implemented in DragHandler (although we could). It just made the target item jump unintentionally. QQuickMultiPointHandler::wantsPointerEvent() returns true for gestures, because PinchHandler handles them, and the pattern is that base classes only rule out some kinds of events but leave the final decision up to the leaf class. The autotest has to use a touchpad now, not the primary pointing device, because QQuickPointerDeviceHandler::wantsPointerEvent() returns false if pointerType != Finger and acceptedButtons() is not satisfied. Fixes: QTBUG-92165 Change-Id: I984de750c9ae892f3ee61c7ed5b3ac4a7d187024 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 73051631545dc59d4419a5ef2202355349aab480) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make PinchArea translate correctly inside a rotated parentShawn Rutledge2021-05-052-0/+136
| | | | | | | | | | | Also includes 9dacc312e5b0f5aeb0f8370f4f7722b57754a3c2: fuzzy comparison in the test to avoid failure due to roundoff. Fixes: QTBUG-63673 Change-Id: I91231bb8555b7eb02a9580f9f184b261d8bd44c8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 7642205be45135add120373299df02e05f4ffc58) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* ListView: support QList<QUrl> modelsMitch Curtis2021-04-305-0/+189
| | | | | | | | | | | | | | | | | | For now this patch just tacks on another list type, but there may be a better way to account for all types in the future. This change also adds tst_qquicklistview2 to speed up development. tst_QQuickListView is 10000 lines long, and compiling it is slow (36 seconds on a 2016 i7 MacBook Pro). In addition, a similar approach (creating a second test to avoid the slowness of a massive one) already exists for QQuickItem tests. Task-number: QTBUG-72906 Change-Id: I05455a2f20978b07eb38591ab63e7d0fb7dac1ab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0e3902b83dc3c59567a81a90c3f3c0365bdf68da) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use QKeyCombination to fix compiler warningVolker Hilsheimer2021-04-281-1/+1
| | | | | | | | | Avoid deprecated implicit cast to int. Change-Id: If89381eda7d92a1b17005d91472070b6ba31fb66 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit a2cf615516309d2baac503444c439ecab7e40ab3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickcanvas: Verfiy that canvas.context existsFabian Kosmale2021-04-231-0/+2
| | | | | | | | | | | Apparently it was possible to execute the pixel check before the canvas was fully created. Use tryVerify to ensure that it is actually is there before running the actual test function. Change-Id: I8e9f1133ea718c001f0456cb3af27f13e6d85e96 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b8451949ba375ecf253fe07a3e043d83d00f9b74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTextInput: update cursor rectangle after padding changedWang Chuan2021-04-162-0/+46
| | | | | | | | | | | The position of cursor delegate needs to be updated when we change padding, otherwise it will be in a wrong position. Fixes: QTBUG-91867 Change-Id: I89ca84fe893ebf517ab67890196eede14a4055d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d98694c4023881673259ba040c10df7e71ec3d37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickItem::forceActiveFocus(): actually force active focusShawn Rutledge2021-04-162-0/+82
| | | | | | | | | | | | | | | | | | | | | It was trying to get by with setFocus() but that doesn't always work, in cases when the item's d->focus flag is true (leftover state) but it doesn't actually have focus anymore after a reparenting scenario. Item.focus represents the intention to be focused when possible, and does not necessarily change due to environmental circumstances, such as having its parent reparented. QQuickItem::setFocus(true) returns early if the new requested focus state is the same as the stored d->focus; so it was not enough for foceActiveFocus() to call only setFocus(). In the bug, TextInput and Loader both get stuck in the state d->focus == true, so forceActiveFocus() did not do anything before. Fixes: QTBUG-89736 Change-Id: Ib7f4caccf81b60a02e2655332b64efba4d1fd7cf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit a8be17a1472c6f504c0c40f68fdc13df035ac4b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix warnings about lossy double/float conversion in testsVolker Hilsheimer2021-04-121-2/+2
| | | | | | | | | | | QColor operates on floats, not qreal or double, so explicitly use float literals in test code. Change-Id: I6f0cb56e861b4812fc79ce67ade9abe3ee9dfddc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io> (cherry picked from commit 8bb955e22f027fc3fd9402383445685cb4185744) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mark overrides in tests to silence compiler warningsVolker Hilsheimer2021-04-121-1/+1
| | | | | | | Change-Id: Ieed929dcd7b550a1dc365d34b6f20f2f0e2d057f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 0d28805cc7790511b9414a900be57f3b2d8d63a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTableView: always update content size when rebuilding small tablesRichard Moe Gustavsen2021-03-272-0/+99
| | | | | | | | | | | | | | | | | | | | | If you have a TableView with only a couple of rows, and you add a third one, the contentHeight doesn't update. This is fine if not all rows are loaded (some are outside the viewport), but when they are all inside, it should update to reflect the exact height. The same is also the case for the contentWidth. If you add a new row that increases the with of a column (and all columns are visible), the contentWidth should update. This patch adds an extra check when we do a rebuild (which we do when you add a new row), to see if all rows or columns are loaded. And if that is the case, we update contentHeight or contentWidth, respecitively. Fixes: QTBUG-92099 Change-Id: I806bfb7c3606fca97c5d27cbb91856cc40df9fb8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit d6a5afd120838647e0dd2a420dacf06389f0a48e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add override keyword in tests to silence compiler warningsVolker Hilsheimer2021-03-253-12/+12
| | | | | | | | Change-Id: Ib18e8aa7acf2c5abd68578f4f4405a977d19d286 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 799495cb7da2aa47c6442f035b4e6a8a3efc5ae8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PinchHandler: scale incrementally when new pinch gesture beginsShawn Rutledge2021-03-251-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | When the gesture begins, we begin multiplying the target item's scale by 1.0 at first; it doesn't make sense to start immediately with the accumulated scale remembered from previous pinch gestures, because the target item remembers its own scale. When QQuickPinchHandler::wantsPointerEvent() returns false because some irrelevant gesture was received (for example a PanNativeGesture), that's not a good reason to deactivate. Deactivating and re-activating with each ZoomNativeGesture event results in extreme behavior, because PinchHandler depends on the BeginNativeGesture and EndNativeGesture events to reset internal state. Likewise, the fact that the button state is NoButton is not a good reason for wantsPointerEvent() to return false. Added an autotest: the first of its kind that actually simulates the native gesture events. Fixes: QTBUG-92064 Change-Id: I3a9b92d70f99497ee58ad8557d90d521fbe16d41 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit fc636af3a723ee8b4ee42cf71864ae0df5ca4621) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTableView: forceLayout() should work, even when no items are loadedRichard Moe Gustavsen2021-03-241-0/+33
| | | | | | | | | | | | | | | | | | As it stood, we would return early from forceLayout if no items were loaded. This made sense, since when no items are loaded, there would be no items to lay out. But after we changed the logic so that an application can show or hide rows and columns by returning an empty size from the size providers, we now always need to do a layout to check if some rows or columns should become visible. Fixes: QTBUG-92076 Change-Id: I2a07bf8e62cfeebcbe36c01aa92eca3ed8227cd3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9ba9336ec4515d157a1207fad1dcd2de311527ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>