aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
Commit message (Collapse)AuthorAgeFilesLines
* qml generator: add functionality for animated (morphing) pathsEirik Aavitsland6 days1-1/+1
| | | | | | | | | | | | | | | | | Add a new Path item to the Helpers module: pathInterpolated, that holds a list of paths (specified as svg path texts) and has a settable interpolation factor property. Based on the value factor, the resulting path will be an interpolation between path #n and path#n+1, where n is the integer part of the factor. The fractional part determines the interpolation weight between the two. Replace the static QPainterPath in PathNodeInfo with an animated property holding QPainterPath values. During generation, if the property is found to be animated, a PathInterpolated item is generated instead of a static PathSvg item. Change-Id: Ic061005e135cbde1bd88ab1ac7c9e7840f55c232 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add effectivelyClipsEventHandlingChildren; skip event delivery when irrelevantShawn Rutledge2025-11-171-14/+49
| | | | | | | | | | | | | | | If a QEventPoint is clearly outside an item _and_ the bounds of all its children, or is simply outside the bounds of an item that clips its children, we can stop recursion, for purposes of QPointerEvent delivery, finding which items/handlers are hovered, or which could control the cursor shape. effectivelyClipsEventHandlingChildren() is also recursive, but at least the result gets cached. Task-number: QTBUG-140340 Task-number: QTBUG-115179 Change-Id: I085e38964de6993fa82ad3bd1256868125fde090 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Reduce QTransform use in event delivery and cursor-finding functionsShawn Rutledge2025-11-112-45/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass localPos to deliverHoverEventRecursive, deliverHoverEventToItem and sendHoverEvent, so that deliverHoverEventRecursive() can merely transform from its own coordinate space to each child's space by calling itemToParentTransform(). That doesn't require up-the-tree recursion like mapFromScene() does. Apply the same trick to QQuickWindowPrivate::findCursorItemAndHandler(). Apply the same trick to QQuickPointerHandler::parentContains(local, scene): now QQuickPointerHandler::parentContains(QEventPoint) also calls that with both local and scene positions, which it already has, so this likely optimizes some use cases outside of the hover and cursor cases. But to make that work, we need to apply the same trick to QQuickDeliveryAgentPrivate::eventTargets() as well, and now it needs to localize the QEventPoint before calling the predicate. Usually, global position is QGuiApplicationPrivate::lastCursorPosition; but when no mouse events occur, only touch events, lastCursorPosition may remain offscreen. So we use the QEventPoint::globalPosition when possible; so it's useful to pass globalPos along to each of these hover functions, so that deliverHoverEventToItem() can construct the QMouseEvent with it, and sendHoverEvent() can construct the QHoverEvent with it. Also amends f5140d62082e9b06e0ca6c8e2175b5836286f52e: that looked rather CPU-intensive to call several mapping functions. The test is retained. Task-number: QTBUG-134099 Task-number: QTBUG-140340 Change-Id: I2c520d430e58ec7c00ada2207541b2936c7ae596 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Mark internal APIs with \internal commandJerome Pasion2025-11-071-0/+12
| | | | | | | | | | | These internal APIs have function documentation but are missing class documentation. Adding an internal class documentation fixes QDoc warnings. Task-number: QTBUG-141697 Change-Id: Iecb289d39e34ddaa964fbe0a1404830cd2269caa Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Increase robustness of <img> tag in Text componentEskil Abrahamsen Blomfeldt2025-10-311-2/+17
| | | | | | | | | | | | | | | | | | | | For Text.StyledText, there was no protection against <img> tags with very large widths or heights. This could cause an application to spend a very long time processing a layout and sometimes crash if the size was too large. We reuse the internal coord limit in QPainter as our maximum size here, similar to what we do in Qt Svg for instance. For Text.RichText, there were no issues in release builds, but in debug builds, you could trigger an overflow assert when rounding the number if it exceeded INT_MAX. For this, we simply cap the width and height at INT_MAX. Fixes: QTBUG-141515 Pick-to: 5.15 6.5 6.8 6.10 Change-Id: I4bcba16158f5f495a0de38963316effc4c46aae1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQuickOverlay: translate touch events that circumvent the deliveryagentOliver Eftevaag2025-10-201-1/+1
| | | | | | | | | | | | | | | | The touch event's scene position is normally set in the delivery agent. However, since the overlay installs an event filter on the window itself, it will circumvent the delivery agent and thus never set the scene position properly. This patch ensures that the scene position gets set when we're entering overlayEvent from the event filter, for touch release events. Task-number: QTBUG-132914 Pick-to: 6.10 6.8 Change-Id: Id59ed9e5252ba594ce0e40039cb3a783032caef1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Improve internal docs for QQuickPointingDeviceExtraShawn Rutledge2025-10-131-2/+9
| | | | | Change-Id: Id097b394eb38c791411730bb8624d9a1c508a785 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* IntValidator docs: Provide guidance on intermediate resultsFabian Kosmale2025-10-101-0/+14
| | | | | | | | | | | | | | | | | | | | | Validators in QML do not actually expose the three states (Valid, Invalid, Intermediate) directly, but only support their usage through TextField. This makes it slightly tricky to raise awareness about intermediate results. Nevertheless, we can expand the example to avoid confusion how IntValidator restricts input, and to encourage users to create a visual indicator based on acceptableInput. The color can also be a binding in the snippet. Amends 17a777a5dfa72e47d02c3e6b4c3a137d923d50bc Pick-to: 6.10 6.8 Fixes: QTBUG-85490 Change-Id: Ia3f7d21d6d7c13943cc2469c4ab8f3c00fd2eada Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add missing Q_INTERFACES(QQmlParserStatus) to QQuickTextSelectionTor Arne Vestbø2025-10-101-0/+1
| | | | | | | Pick-to: 6.10 Change-Id: I3f8d7ab1e6ad147ebede8fdf8a8e050166d0c553 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix internal doc comment on QQuickDeliveryAgentPrivate::eventTargetsShawn Rutledge2025-10-101-4/+4
| | | | | | | | | The comment was from an earlier iteration but didn't match the current implementation. Amends a89a34463bff3d00b96732fd3ebf84116a645248 Pick-to: 6.10 Change-Id: Ib0490b98cfa8f4b17d747b5b77cdedbd13be522a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Resolve documentation build warningsAlexei Cazacov2025-10-031-1/+1
| | | | | | Pick-to: 6.10 Change-Id: I3b0fb5f4f734d3b2a3315479655f6434e8d85b16 Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* Set revision of new TextSelection features to 6.11Shawn Rutledge2025-09-232-19/+19
| | | | | | | Amends 13aa6fee41f8cf37a271309b8b9ebb158f8d066a Change-Id: If9cfa2f8df81d77ffeea06586f61928ff15e04b4 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* deliverHoverEventRecursive(): don't crash if a child disappearsShawn Rutledge2025-09-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Hover event delivery could result in deletion of a child item. If this happens, just stop and wait until the next delivery, to avoid dereferencing a dangling pointer. In QTBUG-139561 an item's layer.enabled is bound to MouseArea's containsMouse. When the mouse enters, a QQuickShaderEffectSource is created, and destroyed again when it exits; but at that time, the QQuickShaderEffectSource is in the QList that deliverHoverEventRecursive() is iterating. We must not try to visit it (or access its itemPrivate, call isVisible(), etc.) after it's destroyed; but tracking each item's lifetime in this high-frequency function would be expensive. So we have to hope that aborting delivery here will not result in chronic hover failure in some other case; but so far it seems this crash is very rare. Usually delivery of a hover event to one item does not result in destruction of a sibling item. Done-with: Lu YaNing <luyaning@uniontech.com> Fixes: QTBUG-139561 Pick-to: 6.10 6.9 6.8 Change-Id: I0f761474ee07c9d6dd669702aff6905023242ac3 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: YaNing Lu <luyaning@uniontech.com>
* Enable declared TextSelection instances to edit text programmaticallyShawn Rutledge2025-09-222-2/+314
| | | | | | | | | | | | | | | | | | | The first qml file in tests/auto/qmltest/textedit seems to determine the import version: switch to versionless imports on all of them so that we can use new properties in the new test. In the autotest, reset the url to planets.txt before each test case, now that we are loading a different file to test duplication of multiple blocks. This reverts commit 295953bfc791ee9a4b0660ee72f54c39e35a3973. [ChangeLog][QtQuick][TextEdit] In addition to TextEdit.cursorSelection, you can now create non-visual instances of TextSelection and use them to modify rich text programmatically. Change-Id: Ia121def3e033054c7cb117e53af877e2596d4e3a Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Set explicit default security level of all files with default securityJan Arve Sæther2025-09-1781-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | The files (folders) already processed are listed in each issue in epic QTBUG-134547 These files were processed half a year ago. In order to make it clear that all of these files are already processed, mark them with an explicit default security header. For the record, this was generated with this script: find -E . -regex ".*\.(cpp|h|hpp|mm|qml|js)$" | xargs python3 ~/bin/add-cra-header.py in the folders listed in each subtask of QTBUG-134547 (add-cra-header.py only exist at my desktop, but it simply adds the default security header if it doesn't already have any existing security header) QUIP: 23 Fixes: QTBUG-134547 Pick-to: 6.10 6.9 6.8 Change-Id: Ieb8c78ea6561fdbdd27c7b13185ece853eedf80f Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QQDAP::deliverPressOrReleaseEvent: return true if event was acceptedMitch Curtis2025-09-161-1/+4
| | | | | | | | | | | | | | | Previously it was returning event->allPointsAccepted(), which can be false even if the event was accepted, because the event points' accepted states are set to false before delivery. This fixes an issue where a MouseArea under a ContextMenu created by a text editing control would emit its pressed signal when a MenuItem in a popup window above it was clicked. Fixes: QTBUG-139342 Change-Id: I4d4043929c316a8e70fecdb4a8b23b48f9442390 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Add some notes about PathText usage in Quick ShapesEirik Aavitsland2025-09-051-0/+7
| | | | | | | | | Note the expected fill rule, as defined by TrueType, and explain that if the stroked outline looks bad, it's the font's fault. Pick-to: 6.10 Change-Id: I8c4c7d319c96d2514c3b11f27a7e85b7c408a79d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Clarify PropertyChanges::explicit documentationJerome Pasion2025-09-051-2/+3
| | | | | | | | | | -The use of "once-off" can be problematic when translating and a more precise description is needed. Fixes: QTBUG-138886 Pick-to: 6.9 6.10 Change-Id: Ifb240fe14752476d3a0072c0ab993fac872f096a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQuick: Add revisions to new signals in QQuickShortCutUlf Hermann2025-09-051-2/+2
| | | | | | | | Found during API review. Pick-to: 6.10 Change-Id: I77403b7779763350ec6df5f5bd34f6e9ede81929 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickPopup: unparent popupItem when window is set to nullMitch Curtis2025-08-271-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interacting with Popups in async Loaders caused a crash because the popup's window was null: 1 QScopedPointer<QObjectData, QScopedPointerDeleter<QObje qscopedpointer.h 112 0x7fffe8effafe 2 qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointe qtclasshelpermacros.h 137 0x7fffe8efd9c3 3 QQuickOverlay::d_func qquickoverlay_p.h 76 0x7fffe8f729d4 4 QQuickOverlayPrivate::get qquickoverlay_p_p.h 37 0x7fffe8f8c392 5 QQuickPopup::overlayEvent qquickpopup.cpp 3214 0x7fffe8f879c2 6 QQuickOverlayPrivate::handleHoverEvent qquickoverlay.cpp 192 0x7fffe8f6ee88 7 QQuickOverlay::childMouseEventFilter qquickoverlay.cpp 478 0x7fffe8f701e4 8 QQuickDeliveryAgentPrivate::sendFilteredMouseEvent qquickdeliveryagent.cpp 2897 0x7fffeb1bce04 9 QQuickDeliveryAgentPrivate::sendHoverEvent qquickdeliveryagent.cpp 1090 0x7fffeb1b25af 10 QQuickDeliveryAgentPrivate::deliverHoverEventToItem qquickdeliveryagent.cpp 1272 0x7fffeb1b2fd0 [...] We can avoid this by unparenting the popupItem, which removes it from stackingOrderPopups and hence excludes it from receiving events. The fix causes a crash in QQuickDeliveryAgentPrivate::clearFocusInScope after tst_QQuickPopup::closePolicy() finishes, because it tries to access the now null window. Add checks for that. Task-number: QTBUG-139306 Pick-to: 6.5 6.8 6.9 6.10 Change-Id: Id507e39497af3cacc832db4b23a2c27a0788dc74 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* DeliveryAgent: stop sending hovering mouse moves to grabberShawn Rutledge2025-08-132-1/+21
| | | | | | | | | | | | | | | | | | | | For applications running under Qt Wayland compositors, touch events may be accompanied by fake mouse moves coming from the touchscreen device. That might or might not be useful: but since most of Qt Quick ignores such stray mouse moves, and PinchHandler was getting deactivated by them, we now make an effort to avoid delivering them to PinchHandler after it has become the exclusive grabber of those touchpoints (which looks the same as being the grabber of "that" mouse). Added a reminder to the handlePointerEvent() comment that tablet events are different: hover events are not enough, in fact we need to deliver TabletMove events to HoverHandler so that it has a chance to change the cursor (i.e. keep the tst_HoverHandler::deviceCursor test working). Pick-to: 6.8 6.9 6.10 Fixes: QTBUG-123985 Change-Id: I513caf277e2fb87401b3e0bb5547f9623467b423 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Harden namespacingTim Blechmann2025-08-081-2/+2
| | | | | | | | | | | | | | | When using namespaced Qt, we need to prevent symbol clashes with symbols of the same name. * namespace some publicly visible classes * hide classes in implementation in an anonymous namespace * rename read/write to readValue/writeValue to avoid name clash with c functions. Task-number: QTBUG-138543 Pick-to: 6.10 Change-Id: Ica77462c1f81f1e01cc60477e5b56ecfe3c1abb4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Quick: Correctly expose more types to QMLFabian Kosmale2025-07-282-1/+11
| | | | | | | | | | | | | | | | | | | | | In order for QML tooling (and in some cases, the runtime [1]) to work correctly, meta-methods need to use the fully qualified type. Moreover, we need to make sure that types which are referenced are exposet to QML, even if only as anonymous types. Switching signals and slots to fully qualified types risks breaking old style connects, so this is only applied to private headers. This reduces the warnings reported by the Quick_qmllint_module target quite a bit. [1] The runtime often has the meta-type available, which is generally enough. Tooling however will not be able to identify the type and provide e.g. proper auto-completion. Pick-to: 6.10 Change-Id: I706c25d8fdeb79ca3d2488ce1d2e66f79818cfbb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Shortcut: Fix nativeText and portableText when using sequencesFabian Kosmale2025-07-242-4/+30
| | | | | | | | | | | | | | | | | | | | So far, nativeText and portableText only considered the singular key `sequence` property; however, we nowadays promote `sequences` in the case where you have multiple possible values (which notably happens when using StandardKey enum entries that map to more than one entry). To fix the issue, we pick the first entry of the `sequences` list if it is non-empty, and otherwise fall back to the existing `sequence` member. Moreover, we decouple the change signals for the two text properties from the `sequenceChanged` signal, so that we can also signal a change when `sequences` changes instead. Amends 15a07dbd30e3b242a0495eb6a3316411b493fab3 Pick-to: 6.10 Fixes: QTBUG-96350 Change-Id: I49f9b5a17020a8417a95652c759756cc7fdda1b1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Merge BorderShape API into RectangleShapeMitch Curtis2025-07-223-14/+35
| | | | | | | | | This takes the code that was originally going to be BorderShape and merges it into RectangleShape. Fixes: QDS-15299 Change-Id: I8c1133ee5d916b46ba37b852a069b2034eee5a03 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Propagate ignored shortcut key events in quick text edit to parentSanthosh Kumar2025-07-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | The delivery agent generally accepts key events before sending them to the quick item; the corresponding item can further accept or ignore those events. The reason that the user can't override the shortcut key event in the quick text edit is that these events are marked as accepted by default in the delivery agent, and the quick text edit also doesn't explicitly handle the read-only case, which causes the event state to remain as accepted. This patch ignores the shortcut override event by default in the delivery agent. Also, make the quick text edit to execute the configured key handler to either accept or ignore before processing the events. This gives the chance to execute the required shortcut actions. Fixes: QTBUG-136959 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ib6400f083f4e21d1b23db87b002acb1cbd4ac82b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Quick: Fix path element handlingUlf Hermann2025-07-081-2/+5
| | | | | | | | | | | | We need to check the existing path elements before adding the new one to determine whether we need to connect the new one. Amends commit bc586861768ba411be89ec099b796c3c3387b3d6. Pick-to: 6.10 Fixes: QTBUG-138233 Change-Id: If99bbd5ad6f4646e4a36c94d547f6bdc1fb73542 Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
* QQuickApplication: fix typo in code snippetAurélien Brooke2025-07-051-1/+1
| | | | | | | | Amends 9ab16d4117e2fd309bd5ce7c08090e27c7073d21. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I4d398b2d2b80cbaae4ab57e64c65c0717c1b6b7c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQuick: Optimize path element handlingUlf Hermann2025-07-023-21/+121
| | | | | | | | | | | The path elements need to implement removeLast and replace. Otherwise such operations are extremely slow. Furthermore, we can add nullptr to the path list. Don't try to connect or disconnect those. Pick-to: 6.10 Task-number: QTBUG-137554 Change-Id: I15352861d62f1b716954a482444fe71dc4518ea3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix handling of animations in QQuickTransitionUlf Hermann2025-06-301-19/+48
| | | | | | | | | | | We need to implement all the QQmlListProperty methods, and we need to guard against nullptr to avoid crashes. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-137554 Change-Id: I9a222085b4848a9f0ebe59d9e029cabdedc46512 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QQuickPixmapReader: Trigger typeloader creation before thread startUlf Hermann2025-06-241-0/+5
| | | | | | | | | | | The type loader can be requested from different threads but should be created on the engine thread. Amends commit d2bc4a4330254c0c68a0ade51b59a71c4b67b470 Fixes: QTBUG-137848 Change-Id: I30d93e6351bd67ded94956f9832cb87157823373 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Doc: Fix self-referencing "see also" linksDavid Boddie2025-06-211-1/+1
| | | | | | Pick-to: 6.9 6.10 Change-Id: I6837d9b63a0b0252b13c53e74a534749f82a3193 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QtQml: Hold QQmlTypeLoader in QV4::ExecutionEngineUlf Hermann2025-06-171-1/+1
| | | | | | | | | | | ... rather than QQmlEngine. This paves the way for having the type loader attached to ExecutionEngine rather than QQmlEngine. Also, reference the execution engine in the type loader, in turn. Task-number: QTBUG-19407 Change-Id: I04e571c5c6ac5bce5e82537cb96c6940c7186f3a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix for global position in hover eventsPaul Olav Tvete2025-06-041-4/+8
| | | | | | | | | | | | The hover event delivery logic is based on scenePosition, so the global position has to be calculated. Using item.mapToGlobal(scenePosition) will apply the item's position twice. This change first calculates localPosition and then uses item.mapToGlobal(localPosition). Fixes: QTBUG-134099 Pick-to: 6.10 6.9 6.8 Change-Id: I83f1382784300a1c73ab2b6f50e0288dcf99689b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* TextEdit and TextInput: map QContextMenuEvent to text cursor posShawn Rutledge2025-05-021-1/+4
| | | | | | | | | | | | | | | ...if the position is not already set. Events that come from a keyboard menu key or shortcut often have pos() == {0, 0}, but we want the context menu to be in the context of what the user is editing. First though, we need QQuickDeliveryAgentPrivate::contextMenuTargets() to search for items at the correct position. We don't override delivery order, but activeFocusItem should be in the list that is returned. Pick-to: 6.9 6.8 Fixes: QTBUG-136253 Change-Id: I7eea03e118a95a1a267f02bd3385cc1ae4cbb0a0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Support fill-opacity and stroke-opacity in VectorImageEskil Abrahamsen Blomfeldt2025-04-302-6/+22
| | | | | | | | | | | | | | | | | | | | The alpha value of the fill and stroke colors can be animated separately in SVG. In order to support this, we introduce a specialized ColorOpacityAnimation type in a Helpers library which only overwrites the alpha channel of the target property. This requires an extra hook in the animation frame work which allows us to get the current value of the property. It should have minimal impact on any existing code, but may have additional use cases later, when we implement support for additive color animations for instance. Since the interpolator API in QVariantAnimation is public API, we add a secondary, private API for this. If we see use for it in the future, this could mature to a public API as well. Fixes: QTBUG-135322 Change-Id: I803f4e64c41e9d6dc355f2468233661885aa7f15 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Make list items easier to readAndreas Eliasson2025-04-281-26/+52
| | | | | | | | | | | | | The current setup makes it difficult for the reader to separate the actual values from the see also part. This patch capitalizes the See also part and puts it on a new line. Fixes: QTBUG-134606 Pick-to: 6.9 6.8 6.5 Change-Id: I03847c82bbc115ce62358f196dbd26cac87b3497 Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPathRectangle: Merge corner radius and bevel flags into a bitsetMagdalena Stojek2025-04-252-27/+38
| | | | | | | | | | | Replace separate storage for corner radius and bevel with a single 8-bit field cornerProperties. The first 4 bits track radius flags, and the next 4 track bevel flags. Fixes: QTBUG-134908 Change-Id: Ie2d706112965fc5dde07fa698e32e29695da219b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* DeliveryAgent: clear deviceDeliveryTargets before hover deliveryShawn Rutledge2025-04-161-0/+1
| | | | | | | | | | | | | | | | deliverPointerEvent() and deliverSinglePointEventUntilAccepted() already clear the QQuickPointingDeviceExtra::deliveryTargets list before each event delivery (since a97759a336c597327cb82eebc9f45c793aec32c9 and 262d7eb305e1dea8dac660bec3ccc50193258ea9). deliverHoverEvent() needs to do that too: in case there are a lot of hover delivery targets and the user doesn't move the mouse for a long time, but the scene is continuously updated, flushFrameSynchronousEvents() keeps sending hover events, and this list would keep growing if we don't clear it each time. Fixes: QTBUG-135975 Pick-to: 6.5 6.8 6.8.3 6.9 Change-Id: Ia91e3c977b45fc964228d3aad89938435f437449 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Abort QQuickPixmap::load if the QQmlEngine is nullTian Shilin2025-04-151-4/+4
| | | | | | | | | | | | | | | | | If engine is nullptr, calling QQmlEnginePrivate::get(engine) will cause the program to crash trying to access an uninitialized object. The only useful thing this function can do if the engine is null is to find and return a cached image, if any. However, in 0290e0fd5285cd48809ade02ce2e67a423ba3152 it was possible to test QQuickDragAttached without an engine; now there needs to be one associated via a QQmlContext for this test to continue to pass. Pick-to: 6.8 6.9 Change-Id: I28596c2063f0474fc97b2e9a3907f8bb38c78cb1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port away from QPairZhao Yuhang2025-04-124-26/+26
| | | | | | | | QPair is just an alias of std::pair anyway. Task-number: QTBUG-115841 Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Suppress unused parameter warning when tabletevent feature is disabledJuha Vuolle2025-04-101-0/+2
| | | | | | | Amends: f22856cf0c98d7ba85e8db2bcbfe9230089e30c2 Change-Id: I31e38e88515f3a78539da6b74ae74b9a41f967ac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix division by zero in QQuickSvgParserMitch Curtis2025-04-092-2/+12
| | | | | | | | | | | | | | | df97b6b2de6282bd6422f1e531a42475dadc980d in Qt Base added an assert which detected this. This patch adds an early return if we're about to divide by zero, similar to 7ca1222296a9650f24979df57cc2c974a7e571ed. It also amends that patch to move the start point == end point check to pathArc(), since it's called from more places. Fixes: QTBUG-135387 Pick-to: 5.15 6.5 6.8 6.9 Change-Id: If9c5655d5e736825e98d3e93201bf889a1785e49 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* SwipeDelegate: Compare against QLastCursorPosition for default mouse posShawn Rutledge2025-04-012-13/+0
| | | | | | | | | | | | | | | | | So far, QLastCursorPosition's default constructor is using a large number to indicate that the mouse position is unknown (presumed offscreen until we know better); but using its overridden operator== should be more stable than comparison with some other big number that we hope is a little smaller. This reverts commit 7b6622f8e922cf3c19d43c5620f400a6baeba9e7. Task-number: QTBUG-134878 Task-number: QTBUG-134718 Task-number: QTBUG-125906 Change-Id: If4f41517ac7e631421128c251e34e5efc002c394 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add 16-bit/32-bit floating point support for QSGPlainTextureKristoffer Skau2025-03-241-2/+20
| | | | | | | | | | | | | | | | Part of the HDR story is loading images that contain pixel values in bigger ranges than between 0 and 1. QQuickDefaultTextureFactory and QSGPlainTexture automatically converts QImages to RGB(A) 32-bit and textures to RGB(A/X) 8-bit, which are non-floating point based. This change adds support for the additional formats required, which are 16 and 32 bit floating point. It will fall back to 16 bit fp textures if RHI does not support fp 32, and down to the default 8 bits if fp 16 is not supported either. Task-number: QTBUG-126035 Change-Id: I6366f04af26126978e087301108af020749bae54 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add trimming functionality to ShapePathEirik Aavitsland2025-03-241-5/+5
| | | | | | | | | | Allows specifying a subsection of the defined path to be displayed. This mirrors the recently added trimmed() method of QPainterPath. [ChangeLog][QtQuick][Shapes] Add path trimming functionality Change-Id: I76371832df07cbab9d81a557b25a6fd53150630e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix divide by zero when processing invalid arcsEskil Abrahamsen Blomfeldt2025-03-191-0/+2
| | | | | | | | | | | | | If the start point and end point are equal, we will end up with a divide by zero later. df97b6b2de6282bd6422f1e531a42475dadc980d in Qt Base added an assert which detected this. Fixes: QTBUG-134664 Pick-to: 5.15 6.5 6.8 6.9 Change-Id: Ifc00d988713b8495942a1445e69d35c44605dcbc Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* SwipeDelegate: check for believable mouse pos rather than qInfShawn Rutledge2025-03-192-0/+13
| | | | | | | | | | | | | | | | The mouse position is no longer initialized to (qInf, qInf) after qtbase 209a2145f94e99f99832c3a08cdf579d8f42ca55. It wasn't really right to test equality of infinity here anyway: that's what qIsInf() is for. Amends 6bda8fc897b8a4b12720121a45533ef4d2a599da Task-number: QTBUG-134878 Task-number: QTBUG-134718 Task-number: QTBUG-125906 Change-Id: Ice36465ec7eabbaa25b05958118cd5a56c1d7d5c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickPathRectangle: Align corner radius behavior with QQuickRectangleMagdalena Stojek2025-03-182-10/+15
| | | | | | | | | | | | | | | | | | | This change introduces isCornerRadiusSet flag to track whether each corner radius is explicitly set, mirroring QQuickRectangle's behavior. If a corner radius is unset, it correctly falls back to the global radius, ensuring consistency between QQuickPathRectangle and QQuickRectangle. This update is required because QQuickRectangle was modified to use flags to indicate an unset corner radius instead of -1, which previously caused issues when animating. Since tests verify that both components must behave the same way, QQuickPathRectangle has been updated accordingly. Fixes: QTBUG-134404 Change-Id: Id13401ef264a82c2746744ca5accd72f647c65c8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQuickDeliveryAgentPrivate: fix performance regression in eventTargets()Aurélien Brooke2025-03-182-10/+11
| | | | | | | | | | | | | | | | | | | a89a34463bff3d00b96732fd3ebf84116a645248 introduced a predicate parameter to eventTargets. The problem is that it is passed by std::function copy. Since eventTargets is called recursively it can easily, in a heavy scene, lead to hundreds of allocation + deallocations for each single event handling. Pass the predicate as a (qxp::)function_ref to fix this. Since function_ref has reference semantics, we cannot inititalize it with nullptr anymore. So define a noop predicate for the contextMenuTargets() case. Pick-to: 6.9 Change-Id: I6a3162b9b76b197bba07c1725ac7768c8883818b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>