aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
Commit message (Collapse)AuthorAgeFilesLines
...
| * Clear delivery agent delegated focusJere Tuliniemi2022-10-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When focus was delegated, the focused item would remain as an active focus item in the delivery agent after deletion. Further use by the delivery agent would then cause a crash. But since 543598a6cc07d67e7651c9f65c058465ea6d8425 the intention is that the window's DA's activeFocusItem is the one that counts (if there is only one keyboard, there can be only one place to type text; and incoming events will visit the window's DA first.) So any time we clear focus, the window's DA has to clear it, just as setFocusInScope() delegates to the window's DA. Fixes: QTBUG-105192 Change-Id: Iec8c6c67ff18b5dac5ec13fcced6e3fe30423c14 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit de0a6cc47131671963c2ce45ee80c02195d92dbd) (cherry picked from commit ffd1b09cbf0e7a4e611e92e04398fcb374ef4e81)
| * Doc: link to QQuickPaintedItem examplesMitch Curtis2022-10-031-0/+2
| | | | | | | | | | | | | | | | | | So that users can see how to actually use the class. Change-Id: I7ecacb3311b4524426548554f6a75252258eb0a3 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 03738f2197af9aa3897db13efaa57ae3527d7d6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Adjust baselineOffset correctly when fontSizeMode == HorizontalFitJan Arve Sæther2022-09-231-15/+17
| | | | | | | | | | | | | | | | | | | | This caught my attention while reviewing a related fix (4933bd6351feec988746af647c391c46483f049a) Task-number: QTBUG-106594 Change-Id: Ie8c7fb2d9e504b14a924eca72a87295d8764cf39 Reviewed-by: Dominik Holland <dominik.holland@qt.io> (cherry picked from commit a7c8bd27e390db9d0d401f9008ceb4130da53d6f)
| * DA: don't exit early from deliverHoverEvents when we have hovered itemsRichard Moe Gustavsen2022-09-201-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation would exit early if subtreeHoverEnabled was false. The problem is that this can also happen if you set hoverEnabled to false while an item is being hovered. And in that case, we need to prune the list of hovered items. This patch will therefore ensure that we only exit early if subtreeHoverEnabled is false, _and_ no items are currently marked as being hovered. Change-Id: I6086c7cbea07b0973db343a3f439810361c5d1b7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 255c04132455ff404245e9872ef868db528a0bcb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Text: Re-layout the text when a alignment is set and the height growsDominik Holland2022-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the top alignment (default) is used, a growing height can be ignored in some situations and no re-layout is needed. But once the alignment has been changed, the re-layout needs to happen, as otherwise not all anchors are updated correctly. Fixes: QTBUG-106594 Change-Id: I9ab9999f49331aadd3bb8247d520288c40b51b21 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 4933bd6351feec988746af647c391c46483f049a) Reviewed-by: Dominik Holland <dominik.holland@qt.io>
| * DA: ignore disabled HoverHandlers when delivering hover eventsRichard Moe Gustavsen2022-09-162-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the documentation for HoverHandler::enabled, a disabled hover handler will not accept any mouse events. It therefore follows naturally that a disabled HoverHandler should also not affect event propagation elsewhere. This patch will change the implementation, so that we don't deliver hover events to HoverHandlers that are disabled. This also means that disabled HoverHandlers will no longer block propagation to its siblings. [ChangeLog][QtQuick][HoverHandler] Disabled hover handlers will no longer receive hover events, or block siblings from being hovered. Fixes: QTBUG-106548 Change-Id: I7f2e459ba39f1e23cdb13bf94f8754e185dcd0c1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 205e31df1674da5d9de78c4338d3221309086333) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QQuickTextArea/Field: don't block hover eventsRichard Moe Gustavsen2022-09-152-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Controls shouldn't block hover from propagating by default. This was a regression in Qt 6.2 compared to Qt 5.15, and was fixed with 0c7b0a43064c8be452f4be74701f1dabce87f24c. But that patch didn't consider many of the items that overrode hover event handling from c++, like TextArea and TextField; they too need to ignore hover events, to not stop propagation - it's not enough to only do it in the base class. This patch fixes the regression that some controls and items were blocking propagation compared to Qt 5.15. Fixes: QTBUG-104537 Change-Id: Ie047da6ac7d5be5ea6fd52d5a5446787df6d10f5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit cdc0e5cac27890a5ea0590dbdc7cf4c0f624dac2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * PinchArea: Keep the touch/mouse grab when pinch activatedSeokha Ko2022-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Keep the touch/mouse grab when pinch activated to prevent childMouseEventFilter of parent from stealing the event Amends 10800723ab6dacf1203986a6b0815dec45528ef4 Fixes: QTBUG-105058 Change-Id: I6589b7d9cc5cc51ffe5dcaac137d1608604db572 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 4461dfc06b4b1b4bd97a0972ca10a1ab4d53a4c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-6.2.6' into ↵Tarja Sundqvist2023-03-0141-29/+169
|\| | | | | | | | | | | tqtc/lts-6.2-opensource Change-Id: Ie5a87ae61d8ed0429225353ad46e5232d60f4daa
| * Flickable: let changing contentItem pos also affect the drag starting posOliver Eftevaag2022-09-062-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling the setContentX(qreal) and setContentY(qreal) functions, the flickable would not update the drag starting position if they were called in the middle of a dragging operation. This patch makes those function update the drag starting position, so that the drag will take into account the external changes to the contentItem position, and not make any massive leaps on the next call to drag() after changing the contentItem position directly. Note that vData.pressPos and hData.pressPos are set to the x and y position of the contentItem at the beginning of a drag operation. They are unrelated to the mouse position. The bug QTBUG-104966 will be fixed from this, since QQuickItemView::setModel() calls QQuickListViewPrivate::setPosition() which calls QQuickFlickable::setContentX/Y(). The QQuickFlickable::setContentX/Y functions are public (part of the public API). They will update the timeline value for the x and y axis, which will as a result also call setViewportX/Y, which calls setX/Y for the contentItem itself. Done-with: Jan Arve Sæther <jan-arve.saether@qt.io> Fixes: QTBUG-104966 Change-Id: Id5165e1ff37a07b94be8c1cc152e86dfcc13d1c6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 5647527a8cde84b51fff66fc482f02435770b3dd)
| * Optimize QQuickMultiPointHandler::grabPoints slightlyShawn Rutledge2022-09-021-1/+1
| | | | | | | | | | | | | | | | | | Clazy reminded me about the usual const-ref optimization in a range for. Change-Id: I2eafb49d341758829ce8fc43a8e5432a2d6dd4f6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5b81451d448d667b500ae6283ded9e59826e72b3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * PinchHandler: Enforce min/max scale limits with native gesturesShawn Rutledge2022-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | So far the qBound() using m_minimumScale and m_maximumScale was only applied for normal pointer events: there were no limits when using a touchpad that sends native gestures. Fixes: QTBUG-106110 Change-Id: Ibf8d955e5f1dac517e0a3e9588fb117d83f443a6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5cb3ba93da2673b20abae8a544a961b7b57dff45) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: fix typo in QQuickAccessibleOliver Eftevaag2022-08-261-1/+1
| | | | | | | | | | | | | | | | Fixes: QTBUG-105812 Change-Id: I735b23999a87bead759ea7987975c3d4cefdebf8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit af34e238b8bb572097a99b45b8522b120fd102ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Flickable: don't grab on press if already movingShawn Rutledge2022-08-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9f9ea6e1837620a0ff4b98e262cba2df44215967 was too drastic: we cannot simply avoid calling filterPointerEvent() on press, because it calls handlePressEvent() which calls maybeBeginDrag() which sets pressPos, among other things. Failing to set pressPos caused a regression: flicking a second time while the flickable is already moving caused it to "start over" as if it was flicking from the top again. So now we revert that fix, and instead avoid setting stealMouse to true in handlePressEvent(). This makes the second flick more like the first: it waits for move events before taking the exclusive grab; so it's ok for a delegate (such as a Button or MouseArea) to detect the press and take a grab in the meantime. Flickable does not need to grab on press during filtering: it's not a lost opportunity, because it keeps filtering its children's events later on anyway. The flickDuringFlicking() test is added for this scenario. For the same reason as tapDelegateDuringFlicking(), this is also likely to fail on Android for now. This could have some impact on d7b5a485583004ad6a1374a50b7c3f6cab00aca3 but it seems the test that was added there still passes. Fixes: QTBUG-103832 Task-number: QTBUG-38765 Task-number: QTBUG-74842 Task-number: QTBUG-104471 Change-Id: Icb45fcd94847051121ee78a970fbd5f5dc8a42a4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit bb337a0e1c22896984438cbd51ab7473807f017c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Use the time stamp of the touch event when deliver touch as mouseSeokha Ko2022-08-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | Use the time stamp of the touch event when converting a touch event to a mouse event for items that do not handle touch events Fixes: QTBUG-105907 Change-Id: I642093346459a031b77174eeecba8470e103e8dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 3c3aef14865fe8a9865403feb044771a27522256) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Drop duplicated wordPaul Wicking2022-08-251-1/+1
| | | | | | | | | | | | | | Change-Id: Ie1814aa6d990e1caecf0a92d983d8260c48669ec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit e3aeb13052c1d783c92a6043614a196a267d5fea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * A11Y: Send Scrolling Events when Flickable movesJens Trillmann2022-08-191-0/+12
| | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-103513 Change-Id: I6b67ff2611f37a6519420d875e7d9a70d0eb210a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit ac0d923de68cad62d87e116fbb5e5cc2af28349c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * doc: Add missing PointerHandler.CanTakeOverFromItems enum valueShawn Rutledge2022-08-161-0/+2
| | | | | | | | | | | | | | | | | | Amends 0a3eec60cab3c453b378ee45ac335e0dc2951f4b Change-Id: Iae9d1b2b68dc48a52adf0438a09af8e53f5527f1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit c2d92c241274f9abdcb24637f9838210f191e8ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * PinchArea: fix pinches being stolen when in PathViewMitch Curtis2022-08-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Keep the mouse grab in addition to touch, as PathView apparently doesn't deal with touch events yet. Fixes: QTBUG-105058 Change-Id: Id94768aec847138cccdeccfa92e4bc72a19810fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 10800723ab6dacf1203986a6b0815dec45528ef4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Don't compress touch events in subscene DeliveryAgentsShawn Rutledge2022-08-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flushFrameSynchronousEvents() is only called on the window's DA, so a touch event stored in QQuickDeliveryAgentPrivate::delayedTouch in a subscene DA would be lost, unless we make the flush recursive. However, a grabbed touchpoint remembers its DA; when that's a subscene agent, subsequent touch moves are delivered directly via the subscene DA, and touch event compression does not occur at all. This may pessimize performance if touch events occur many times more often than frame rendering, but it's not expected to matter a lot on 3D-capable hardware. Fixes: QTBUG-105566 Change-Id: I9102b20806f9577fba0f741f7589ee5b1642e5a5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 212f31f9eaa0e2ba569ae1458fd0f0dca3c53e60) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Clarify QSGRenderNode docsLaszlo Agocs2022-08-041-7/+8
| | | | | | | | | | | | | | | | | | | | | | It talks about connecting to beforeRendering, but that approach predates 6.0 where in the end QSGRenderNode got another overrideable function, prepare(). Mention both. Change-Id: I9e6fba6df38569917da3b3d318f9eb1894cceb9a Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit a3f0ae13a7e9530d150830c371829912bbf285d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Quick: includemocsMarc Mutz2022-07-2128-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Manual conflict resolutions: - dropped all includes into non-existing files Task-number: QTBUG-102948 Change-Id: I695daa12613de3bada67eb69a26a8dce07c4b85e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 6a23f186138dff2a7007288a02702bce23d7ca70) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Avoid use-after-free in QQuickPathViewUlf Hermann2022-07-212-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When releasing an item we always need to unregister the change listener, even if the model is already gone. The model is a public property and a QPointer. Anything can happen to it behind our back. Furthermore, we apparently don't own items and itemCache. Therefore, we have to listen to their "destroy" events and remove them from the list when those are triggered. Otherwise we operate on dangling pointers when we later releaseItem() from the dtor. Change-Id: I662b0d70b8b06d15b504c6fe1fc33384b1ae12d9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1b8109fc1476e255d1fdb571da884215d9791cec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix memory leak in QQuickItemViewTransitionableItem::completeTransitionUlf Hermann2022-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | As we're not storing the QQuickTransitionInstance anywhere, we better delete it when the function returns. Change-Id: Ife4d0eee559cffd26ddd9aab8c89729269bb93e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 813ba0591893fcca2b427dee73106c8773c3b59f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Add QQDAPriv::allPointsGrabbed() and stop using QPointerEvent::apg()Shawn Rutledge2022-07-132-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPointerEvent::allPointsGrabbed() was implemented wrong in qtbase 8932e80d0c8879a1e720fef825ed0d9c4e384a01. Fixing it has ramifications for event delivery; so it's easier to take care of that in one patch in qtdeclarative first, rather than causing a submodule update crisis, and then fix the public QPointerEvent version afterwards. It fits nicely alongside anyPointGrabbed() anyway. Task-number: QTBUG-101932 Change-Id: I4141a492c941963e5eb716b63d3e09f9ae165c57 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 42eddf0743e09f5b751a68555dba045c17cf8520) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix fractional scaling of text in Qt QuickEskil Abrahamsen Blomfeldt2022-07-121-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As opposed to the raster engine, in Qt Quick we are using unscaled positions for the glyphs and using the vertex shader to scale these after the fact. However, when picking the correct subpixel rendering for each glyph, we would use the unscaled position's fractional part, meaning that we essentially rendered the glyphs at the wrong subpixel position. This was especially visible when doing fractional scaling, e.g. 125%. Instead, we need to ensure that we pick the rendering at the on-screen subpixel position. [ChangeLog][QtQuick][Text] Fixed a kerning issue with native-rendered text when there is a fractional system scale factor set. Fixes: QTBUG-101008 Change-Id: Ic0f94d8b4ca5998dca638bdf7e2a16306d92a926 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 97cc7023ce8b8d903351a2e13f515592854c56fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Consistently set and reset QQuickPointerHandler's currentEventVolker Hilsheimer2022-07-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Set the pointer before we deliver to the handler implementation, and reset to nullptr afterwards. Fixes: QTBUG-104325 Change-Id: I37ddcb7b20760867ebfd3f23449c6a83088926aa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6b871adfa2f75bf039de390d2b379ddea3aa3eae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Delete transition when it's canceledBumjoon Park2022-07-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If next transition occurs before previous transition ends, the animation of the previous transition is canceled. The problem is that it is not removed from A while it is being canceled. At this time, if a new job comes in translator->runningJobs,'busy' state cannot return back to its original state and mouseEvent/ touchEvent are broken. So, in case of transition canceled, we should remove the transition. Fixes: QTBUG-104491 Change-Id: I33083822763bdc006eb35262b9c216f27989139a Reviewed-by: Bumjoon Park <bumjoon.park@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 572b3ae9f32d039ed2b14a50731e939422646da4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QQuickWindow: Implement QWindowPrivate::clearFocusObject()Richard Moe Gustavsen2022-07-052-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 68c103225f4e8bd removed the overridden function QQuickWindowPrivate::clearFocusObject(). This is quite unfortunate, since it's used by e.g QPA/iOS to clear the focus object when the input panel is closed. The result is that if you hide the input panel by swiping it down, a TextField with focus will not loose focus anymore, but continue to show a blinking cursor. Moreover, you cannot bring the input panel up again by clicking on the TextField, since it's focused already, so no change will be reported back to the platform IM. Fixes: QTBUG-104642 Change-Id: Ic27aaa2cc8d11cbf64ba8d3797ab4008bc2eb3a6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 65891f65fb26d4383a60aae745f6065642174261) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Revert "Update commercial license headers"Tarja Sundqvist2022-11-24473-10223/+10223
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 74089697cf2a4961fb697100555b17ae2342d734. Revert of commercial license headers is required for the Qt 6.2.x opensource releases, Qt 6.2.5 onwards. Task-number: QTBUG-107760 Change-Id: Id49069cb5e5f261da185fd082dfb71deb259d387 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Flickable: don't grab on press if already movingShawn Rutledge2022-07-011-2/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9f9ea6e1837620a0ff4b98e262cba2df44215967 was too drastic: we cannot simply avoid calling filterPointerEvent() on press, because it calls handlePressEvent() which calls maybeBeginDrag() which sets pressPos, among other things. Failing to set pressPos caused a regression: flicking a second time while the flickable is already moving caused it to "start over" as if it was flicking from the top again. So now we revert that fix, and instead avoid setting stealMouse to true in handlePressEvent(). This makes the second flick more like the first: it waits for move events before taking the exclusive grab; so it's ok for a delegate (such as a Button or MouseArea) to detect the press and take a grab in the meantime. Flickable does not need to grab on press during filtering: it's not a lost opportunity, because it keeps filtering its children's events later on anyway. The flickDuringFlicking() test is added for this scenario. For the same reason as tapDelegateDuringFlicking(), this is also likely to fail on Android for now. This could have some impact on d7b5a485583004ad6a1374a50b7c3f6cab00aca3 but it seems the test that was added there still passes. Fixes: QTBUG-103832 Task-number: QTBUG-38765 Task-number: QTBUG-74842 Task-number: QTBUG-104471 Change-Id: Icb45fcd94847051121ee78a970fbd5f5dc8a42a4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit bb337a0e1c22896984438cbd51ab7473807f017c) Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
* Flickable: Fix edge hitting detection when the extent is fractionalOliver Eftevaag2022-06-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the extent is fractional, the updateBeginningEnd() function would not be able to detect if the contentItem is hitting an edge or not. This is because the target move position for when a flick is initiated, is at some point rounded (in QQuickFlickablePrivate::fixup()), while the extent is not. This patch will ceil the minExtent/topMargin, before checking whether the contentItem y position is hitting it or not. This value is normally negative, and the ceil will thus be closer to 0. This will mean that if the target move position is rounded to be closer to 0, it will now count that as hitting the edge, even in cases when the topMargin is a few subpixels further away (which is not visually noticeable). The same logic is applied to the maxExtent/bottomMargin, and for the x axis. Furthermore, this patch also improves the scrolling logic in wheelEvent, ensuring that flickingStarted() and movingStarted() are not called unless 1) the contentItem is currently standing still, and 2) the scrolling isn't directed towards the edge while the contentItem is near it (no movement should occur in this case). Here is a more holistic expanation for what was happening in the reported bug: Scrolling a flickable will cause an "artificial" flick, unless the user has scrolled the maximum distance in a particular direction. When flicking, a timeline is started with a goal for what the contentItem's position should end up being when the timeline completes. As the timeline advances, it will callback the fixup function, which will round the target x and y move position for the contentItem. Which is used to check whether the contentItem is hitting an edge or not. A fuzzy compare is being done here, but since the extent isn't being rounded, it will fail when the extent is fractional. When you scroll with the wheel, QQuickFlickable::wheelEvent will typically be called a couple of times, and we don't want to call flickingStarted() or movementStarted() when the Flickable has already scrolled to its limit in a particular direction (an edge). While calling flickY() is undesired in this situation, the larger problem is movementStarted(). This function will set the the moving flag in vData to true. The moving flag in the hData and vData is used in a lot of different places, to figure out what to do in special situations (like resizing the window). But the moving flag is only set to false upon a call to timelineCompleted() (which unsurprisingly is called when the timeline is completed). What was happening in the reported bug, is the following: 1. wheelEvent() is called, and starts flicking the listview towards the edge. 2. The destination for the flick is rounded, to have a lower absolute value than the extent. 3. Any subsequent calls to wheelEvent() will also call flickY() and movementStarted(), setting the moving flag to true, even though no movement is occurring (since the contentItem has already reached it's maximum or minimum value). 4. Since flickY() isn't really doing much when it's called (since the source value == destination value), it will cause the timeline to complete instantly, inside the flickY() call. This would lead to the moving flag being set to true in the movementStarted() function, that is called right after flickY() in wheelEvent(). The moving flag would remain true forever, since timelineCompleted() must be called for it to become false again, but that function was called before movingStarted(). The user would need to flick in a different direction for it to go back to false again. 5. Since the vData.moving flag is set to true, fixupY() will not get called from QQuickFlickable::geometryChange() (when resizing the window). Normally, when resizing the window, the adjustContentPos() will get called, which will provide the timeline with the correct new contentItem position, and use the Immediate fixupMode, that will cause the timeline to complete immediately. If the vData.moving flag is true, all of these fixup steps will be skipped during geometryChange(), which was the case in the reported bug. In the above description, I've mostly been talking about the behavior that happens when scrolling in the vertical direction, but I see no reason why this couldn't theoretically happen in the horizontal direction as well. Therefore, I am applying the same fix for scrolling horizontally. Fixes: QTBUG-101268 Fixes: QTBUG-101266 Change-Id: I0e56290541a9f28a5489d92251f059e7448184f0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 833f83f270e844265905e4657ef74319b7b8b68f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle unprocessed pressed case in FlickableAntti Määttä2022-06-231-2/+21
| | | | | | | | | | | | | | | | Handle case where Flickable filters a pressed event before the receiver has decided whether it wants to keep the grab. That causes the Flickable to not process the press event, but still processes all the later events. This happens when the receiver is MouseArea so add special case for it in Flickable, where we start the drag if all conditions are met. Fixes: QTBUG-38765 Fixes: QTBUG-74842 Change-Id: I2e02042cb496e9eb3b7b5da824e56f76ee76ccbb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d7b5a485583004ad6a1374a50b7c3f6cab00aca3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Flickable: don't grab on press if already movingShawn Rutledge2022-06-181-8/+10
| | | | | | | | | | | | | | | | But rather cancelInteraction(). The Flickable stops moving, as before, which feels like correct "physics"; but the tap is also often meant for a delegate or something inside. As a drive-by, optimize slightly: check e->isPointerEvent() and do the casting only once. Fixes: QTBUG-103832 Change-Id: I16cb670a06d94b53e56dd85c910becf747a75f8a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 9f9ea6e1837620a0ff4b98e262cba2df44215967) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix alpha with native text renderingLaszlo Agocs2022-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The immediate problem with incorrect semi-transparent Text with NativeRendering is a porting error from 5.14 times, comparing with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp?h=5.15#n292 shows that the constant color used for blending does not have alpha premultiplied into the color in 5.15. In the rhi-based code updateUniformData does the premultiplication when setting the data for the uniform, like in Qt 5, but then in upgradeGraphicsPipelineState it also multiplies whereas Qt 5 did not. In fact that there's a Q_UNUSED(state) at the top of the function shows that accessing state.opacity() was not meant to be there in the first place and got added later for reasons unknown. Fixes: QTBUG-100820 Change-Id: I3acb839676c00e7aa1e2ff2f93eefcaa87b7d0de Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 08e2a90f9afd0a7852f4f594029fa21d2fc1478e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Port QV4::CompiledData::Binding to new special integer bitfieldUlf Hermann2022-06-131-13/+22
| | | | | | | Task-number: QTBUG-99545 Change-Id: I9f8bc5fa45c61f77ee95b055a3d8de001da8f8c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 36ebee4e69182f0e44d87691d4740b271e1dcf38)
* Item views: fix error when accessing attached view from non-delegatesMitch Curtis2022-06-104-2/+38
| | | | | | | | | | | | | Ensure that the view is set on the relevant attached objects before QQmlComponent::completeCreate() is called, which would otherwise result in a TypeError because the view would be set too late. Fixes: QTBUG-104026 Task-number: QTBUG-98718 Change-Id: Ic65370bd4534e7452f2377ab4d60a74badf02079 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit dbd108a7997f129004bbed523db75d4aa9d0ab6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MultiPointTouchArea: remap touchpoint positions when filteringShawn Rutledge2022-06-082-4/+9
| | | | | | | | | | | | | When MPTA filters a touch event during delivery to a child item, QEventPoint::position() is relative to the child; but MPTA updates its stored QQuickTouchPoint instances from the event's touchpoints and emits pressed(). Now it will first remap them into its own coordinates. Fixes: QTBUG-74028 Change-Id: Ia4e64aa829d9d4d452a03bc964f06c729baa8f78 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 664f986571696414fe2446f80c1b45edf9961999) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QSGRhiShaderEffectNode: remove unused m_rc memberMarc Mutz2022-06-082-3/+2
| | | | | | | | | | | | | Found by Clang after includemocs: qsgrhishadereffectnode_p.h:145:30: error: private field 'm_rc' is not used [-Werror,-Wunused-private-field] QSGDefaultRenderContext *m_rc; ^ Change-Id: I915751abb01d9ff5d57c364be333ca2c171eaa97 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 8a963700499a4264edaf462d906128f662a090fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DeliveryAgent: don't cancelTouchMouseSynthesis() prematurelyShawn Rutledge2022-06-081-3/+11
| | | | | | | | | | | | | | Do cancelTouchMouseSynthesis() when all touchpoints are released, or when the touchmouse is released; but not because another point is released while the touchmouse is still held. Fixes: QTBUG-102996 Fixes: QTBUG-103766 Change-Id: I1de21c1119ab1c420f41af32580b25691d28f14e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 68bfa46f6c712fce0b00a7bbe6fa22e4f42079b9)
* Text: don't fall back to full-width layout if availableWidth == 0Shawn Rutledge2022-06-081-1/+1
| | | | | | | | | | | | | | If Text.width == Text.rightPadding, there is no space to render any text; but in that case, QQuickTextPrivate::availableWidth() returns 0: it's incorrect to fall back to layout.maximumWidth() and allow rendering the whole line. Prior to 6ec2693d4a3c95ca9ff0c349d3c587a7f1402c05 we were checking width() here, so let's do that again. Fixes: QTBUG-83413 Change-Id: I3ee3b49406577c3aa005a3ca3606308ff0a21d8d Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 406ff6b53d02b8db4231e473982fe593fb1e48c6) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QSGBatchRenderer: look for ShaderManager by type only, ignore nameMarc Mutz2022-06-041-1/+1
| | | | | | | | | | | | | | | | There's only ever one of them, and accessing objectName() from a different than the owning thread is UB (data race). The default-constructed QString() is needed, cf. QTBUG-103986. This is a hotfix for QTBUG-102403, which ran afoul of the guards added in qtbase/3f32dcd1ddcbe04c77ccd83e2eaa566d7212e732 to fix QTBUG-99775. Task-number: QTBUG-102403 Change-Id: Idf07b1119ec393e7fd179e8b545cfeb70f5916ec Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 543806e96da237a4625b593ed773813e0cdfe3fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickFlickable: fix flicking when item is rotatedShawn Rutledge2022-06-042-5/+19
| | | | | | | | | | | | | | | | | | | | | | QEventPoint::velocity() is in screen coordinates, as documented; it needs to be transformed to local coordinates in case the Flickable is rotated and/or scaled. windowToItemTransform() gives us a composite transform matrix; we remove the translation components to get only the rotation and scaling. Also fix the press position calculation in handleReleaseEvent(). With the manual test one can pinch to scale and rotate a Flickable, then verify that with a single finger, the Flickable gets scrolled by an appropriate distance in spite of that. Done-with: Ivan Solovev Fixes: QTBUG-99639 Change-Id: I60af1dd932835d358baa1422523cc24b2ab046a0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 8068bde891eefe99a43deb83e58166b476f65225) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: QQuickTextInput: Mark all readonly properties as suchIvan Tkachenko2022-06-041-3/+20
| | | | | | | Change-Id: I5fa12286ac594bafff89a56358bdda4051733e05 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit cb2cccd5578ffcfcbf6793c0a445022a6fd4a8ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: Fix inherited property docs in HoverHandlerShawn Rutledge2022-06-045-0/+306
| | | | | | | | | | | | | Some base class snippets use TapHandler, but it's better to show snippets specifically with HoverHandler. These snippets are also runnable and thus testable. Fixes: QTBUG-95395 Task-number: QTBUG-101932 Change-Id: Ibcdc30ff8a785a3651177c79522332cf09c3013c Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit a76ad7ef6a87af074612897ea6df30167ebe698e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickStateGroup: Check "when" binding for context before evaluatingUlf Hermann2022-06-041-3/+7
| | | | | | | | | | | If it doesn't have a valid context evaluate() will crash. It's unclear how this is triggered, so we cannot easily construct a test. Fixes: QTBUG-102729 Change-Id: I9f08d43bd41e657870fa2f8cf23460570fd9bcee Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3fb46f78cfa4ab753e1d6b066528d5544d37e23d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: link to SystemPalette in more placesMitch Curtis2022-06-043-2/+4
| | | | | | | | This is useful for getting palette colors from anywhere in a QML app. Change-Id: I367beae62245c48f3b0184aebadbf6e9c515c9a8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit e6d37999e72b56200751c1e0b5b96470dc742b37)
* MouseArea: don't override preventStealing on mouse releaseShawn Rutledge2022-06-041-1/+2
| | | | | | | | | | | | | In setPreventStealing() we call setKeepMouseGrab(); so it does not make sense to override setKeepMouseGrab() in other places without even checking the state of the preventStealing property. Fixes: QTBUG-103522 Change-Id: Ib4a2b01b814835715642aec83fac0a84debe2461 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d92f1dfe05370c4a2ca7d86810e00b7466f454ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not re-source the from value in animation with multiple loopsAndreas Buhr2022-06-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Animations with multiple loops without an explicitly set 'from' value were trying to use the last value from the previous loop as the new starting value for the next loop. This is not correct for several reasons: - when we have multiple loops, it's not guaranteed that the last value of the previous loop is actually the 'to' value. In practice it is a bit smaller. - even if it was the expected 'to' value, the next loop would have been executed in the range [to; to] - so nothing would have happened. The code in bugreport for the related issue tries to implement a binding: NumberAnimaton { // note that the 'from' property is not defined here to: from + 360 loops: Animation.Infinite } But I believe such binding does not work in practice, because the 'from' *property* is not actually updated at each loop. So the most reasonable approach for the animations with multiple loops is to use their initial 'from' value, and do not update it while looping. Fixes: QTBUG-84375 Change-Id: I550873887bf8a328fe4eda9b0e8e058f921124b1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit cc49e68bdf5be947cd9a6aac07bc9915fe0c5af4)
* Avoid memory leaks in QQuickListView and tst_qqmlinstantiatorUlf Hermann2022-06-041-1/+3
| | | | | | | Change-Id: Ieceffedb082e893b54bcda99076df3ccdeff6010 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit cf9c0f0180b65f0f2ad2cf20a35a3d11a7430927) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>