aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
Commit message (Collapse)AuthorAgeFilesLines
* Private API for giving an Item its own OverlayPaul Olav Tvete3 days2-1/+15
| | | | | | | | | | | | | | | | | | | There are cases, such as Item2D in QtQuick3D, where a Qt Quick user interface is not placed directly inside a QWindow. In that case, Menu and other Popup items need to be shown in the context of the toplevel Item rather than the window. There are two separate Popup implementations: A popup can either be a toplevel window known to the windowing system, or it can be an Item that lives in a special Overlay layer, which normally fills the entire window. This change adds private C++ API in QQuickItemPrivate to add a custom Overlay to an Item. This does not in any way affect the case where a popup has its own toplevel window. Task-number: QTBUG-142145 Change-Id: Ic96a450f6d47e43d1ffc8226b27c1dc5d62e3497 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Flickable: add positionViewAtChild, flickToChild, flickTo(position)Xavier BESSON5 days3-14/+250
| | | | | | Fixes: QTBUG-141747 Change-Id: Icc194fb35da84f580b3bdfcb64944f5834b766dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Document caveats of setting user input on Text componentEskil Abrahamsen Blomfeldt11 days1-2/+16
| | | | | | | | | | | | | | | | | | | | The HTML subset in Qt was never intended to be end user facing and is very specifically modelled to Qt's needs. Without precaution, an application can easily end up setting a user provided string as content on the Text component. This can cause both unexpected results for the end users (if they expect a compliant HTML engine) and arbitrary image loading/allocation. Since the default text format of Text is AutoText, we make sure to document that user provided data should not be set directly as content on the label unless the PlainText format is explicitly selected. Pick-to: 6.5 6.8 6.10 Change-Id: I4383389640ff140da1ccbdf58e198e2868ad9774 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Window: specify correct property typeFabian Kosmale11 days4-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | Given that the property was documented to only take a screen from Application's screen list, we can arguably do this change, especially that any usage with a non-QQuickScreenInfo would just end up setting a null-pointer, indicating some bug. Any code reading the property is fine anyway, as a QQuickScreenInfo is still a QObject. This also uncovers that the screengrabber base line test did not handle this correctly (it passed a QScreen to setScreen, which doesn't work). This would now fail to compile. Fix it by passing the actually expected object along. Amends d6dfbe8fd5d09388fc624d85c4aefa0269c20db9 [ChangeLog][Important Behavior Change][QtQuick][Window] Window and ApplicationWindow now enforce that the type of the property passed to the screen property is ScreenInfo. It used to accept any QObject, but would silently convert it to null if the type was not correct. Change-Id: I512c24c761ef5e6e9b7f241d222c98a34c6fafa4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix QQuickItemPrivate::eventHandlingBounds()Shawn Rutledge12 days1-1/+1
| | | | | | | | | | The second two arguments are width and height, not bottom-right coordinates. So after shifting the rectangle left and upwards, we need to add twice the margin to width and height, to have the same margin all the way around. Amends 8115731466b579f33295d5c8a71506475750284e Change-Id: I83797ffd460ee47599170090aefcda544c3e4483 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* quick/items: fix build when qreal is floatNick Shaforostov2025-11-172-4/+4
| | | | | | Pick-to: 6.10 6.8 Change-Id: Idc096a96c3c6895b09a97b6ef2d644d8b0454b60 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add effectivelyClipsEventHandlingChildren; skip event delivery when irrelevantShawn Rutledge2025-11-175-11/+152
| | | | | | | | | | | | | | | 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>
* tableview: fix build with -no-feature-cursorNick Shaforostov2025-11-131-1/+3
| | | | | | | Pick-to: 6.10 Change-Id: I2667210311de7ee41db1d90fff71d4d4bb388ee2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QQuickText: re-layout eliding text that grows in widthOliver Eftevaag2025-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | Laying out text is somewhat expensive, which is why the geometryChange function tries to determine whether or not it's necessary. However, when growing the width of multi-line eliding text, we would over-optimize, and stop relayouting, when there would have been more space for text. This worked for single line text, since then the widthExceeded flag would always be set to true, when the natural text width exceeds the layouts width. However, we don't always set that flag for multi-line text, thus it's possible that we skip the relayout step every time we increase the width of the Item. Fixes: QTBUG-140875 Pick-to: 6.10 6.8 Change-Id: I1f7758bed2c52044d0179a83d4bf4a774f22e4e3 Reviewed-by: Bror Wetlesen Vedeld <bror.vedeld@qt.io> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Reduce QTransform use in event delivery and cursor-finding functionsShawn Rutledge2025-11-112-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+5
| | | | | | | | | | | 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>
* doc: delegateModelAccess was added in Qt 6.10Kai Uwe Broulik2025-11-064-0/+4
| | | | | | Pick-to: 6.10 Change-Id: I795c2a35e2fec71d8dbe481ff334b9bcfdf6692a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add dev-only static item statistics in QQuickItemPrivateJan Arve Sæther2025-11-063-0/+32
| | | | | | | | | | | | | | Statistics are useful for profiling. - count of total items ever created, obviously has many uses - how many of those also have ItemExtra? - how many times did we call the QTransform-construction functions during the course of event delivery and for other reasons? (This is one of the most expensive runtime costs at present.) Task-number: QTBUG-140340 Change-Id: Id7443f0dcf9e038f446304f371e29bfa612fcad2 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Expose window devicePixelRatio as a propertyMarco Martin2025-11-052-0/+23
| | | | | | | | | | | | | | | | | | On some platforms only the window knows the correct devicePixelRatio which is different than the one on QScreen. On QWindow changes to devicePixelRatio are exposed through an event so we make forward the event to a signal here. We hook it to QQuickWindow's effectiveDevicePixelRatio because it takes into account QQuickRenderControl::renderWindowFor() and QQuickRenderTarget::devicePixelRatio() Effective device pixel ratio is returned as it is the one that matters for rendering or calculations for sizes. QQuickWidget forwards the events to the QQuickWindow already. Fixes: QTBUG-141448 Change-Id: I2908b52dbcf005ec25ba282c92906eb6172c9d19 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Increase robustness of <img> tag in Text componentEskil Abrahamsen Blomfeldt2025-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* Rich text: Limit size of text objectEskil Abrahamsen Blomfeldt2025-10-311-6/+10
| | | | | | | | | | | | | | When we draw a text object, we need to store this in RAM since the QTextObjectInterface is QPainter-based. This could lead to over-allocation if the text object size was set to be very large. We use the existing image IO infrastructure for making sure allocations are within reasonable (and configurable) limits. Pick-to: 5.15 6.5 6.8 6.10 Task-number: QTBUG-141515 Change-Id: Ieae06a9e92a7bd078d22ab2314889201c2049122 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* a11y: Make QQuickTextInput accessibleMichael Weghorn2025-10-302-0/+82
| | | | | | | | | | | | | | | | | | So far, accessibility logic was implemented in QQuickTextField, while its base class QQuickTextInput didn't have any implementation. Most of the existing logic only requires QQuickTextInput(Private), however. Move that logic to the QQuickTextInput(Private) base class and only leave the QQuickTextField-specific logic in the subclass. Task-number: QTBUG-139943 Fixes: QTBUG-140441 Change-Id: I757222a7b6c21b575bfe404333cc7ed91af86ed7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Reorder QQuickRotationPrivate members by typeJiDe Zhang2025-10-301-2/+2
| | | | | Change-Id: Ic4def3b9649cf369be97b18cf7916ddef4ee5ade Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add distanceToPlane property for QQuickRotationJiDe Zhang2025-10-302-2/+47
| | | | | | | | Followup to a6b55b3c46cf47d560e10a4b69db24a475261546 Change-Id: If35cb2b3ab5654549e76fc18ad094acdc7a832eb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Consider new Switch role introduced in qtbaseLars Schmertmann2025-10-271-4/+5
| | | | | | Task-number: QTBUG-139676 Change-Id: Iea39ae7c18e71956e7a101a86425c84d876e8730 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
* Allow text edit to process key events when shortcutoverride configuredSanthosh Kumar2025-10-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The shortcut override has been made to be ignored by default as part of the patch 1aefea26e5a574dad25646d330a6b3bb943a596c. And the further changes in the same patch were made to check whether the shortcut override can be accepted by text edit before processing the events. If the shortcut override has not been accepted (either by default or explicitly ignored by the user), the keys would be processed further by the textedit. The validation added as part of the same patch for processing the event doesn't seem to be correct, as it allows the key to be processed by the text edit control only when the key handler is not configured. This approach seems to be incorrect, as the text edit control shall be allowed to process the key events regardless of key handler configuration. This patch removes that validation, thus allowing the text edit control to process the key events regardless of key handler configuration. Fixes: QTBUG-139679 Task-number: QTBUG-136959 Pick-to: 6.10 6.8 6.5 Change-Id: I7c066e5f3709a00d0b18f0c5e8b9d1f7944c4e4e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* TextInput: don't clobber text cursor visible stateMorten Sørvig2025-10-171-2/+6
| | | | | | | | | | | | | | | | | User code connected to onTextChange may cause changes which affect the text cursor visibility state, for example by moving focus to a different item. Set set text cursor visibility state before updating the text in order to avoid overwriting state changes from user code. Fixes: QTBUG-131895 Pick-to: 6.10 6.9 6.8 Change-Id: I8e8ae7497b56067eb251e318c1fbff23c8e46332 Reviewed-by: Lorn Potter <lorn.potter@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickShaderEffectSource: Don't cut off bottom row of texturePaul Olav Tvete2025-10-141-2/+8
| | | | | | | | | | | | | | | | | | When the source height or width is not an integer number of pixels, the texture size will be rounded up. This could cause the bottom/right edge of the texture to be omitted, since the target size for the image node was also not in whole pixels, and the pixel coverage for those edge pixels could become <= 50%. This patch rounds up the targetRect to match the texture size, so it will be rendered at exactly 1:1 when the scale factor is 1. Note that this only fixes the issue for integer scale factors, since the target size is calculated in updatePaintNode, which is not called when the scale changes. Fixes: QTBUG-136783 Pick-to: 6.10 6.8 Change-Id: I0d04e4efa65d4a77f842fc3093a143ceb6666608 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* CanvasImageData: Track image data size for gc purposesFabian Kosmale2025-10-101-1/+6
| | | | | | | | | | | | Images can consume a substantial amount of memory on the native heap, while the actual CanvasImageData object is rather small. Our gc already keeps track of native heap consumption (e.g. for strings), so reuse that support to also properly account for CanvasImageData. Pick-to: 6.10 6.8 Fixes: QTBUG-32298 Change-Id: Ie36e9c2399517154d9c46e490a49b16409cbecc1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Skip synthesis of QContextMenuEvent if eventpoint has a grabShawn Rutledge2025-10-091-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQuickWindowPrivate::maybeSynthesizeContextMenuEvent(), if the mouse event's QEventPoint already has a grab (passive or exclusive), it may be that a TapHandler with default gesturePolicy has onTapped: menu.popup() or a MouseArea has onClicked: menu.popup() or something like that. We can at least detect that a MouseArea has an exclusive grab, or a TapHandler that handles the right mouse button has a passive grab, although we cannot see what it will do in the future when the right mouse button is released. We don't want to flash up a menu on press if the user's code is going to show a menu on release, so don't send the QContextMenuEvent, just in case. Amends 24ac76941e899a7a92c5c06f70bc2b9f0344daf0 and 9ac0e70cdbf99e06761b6edb28937fded8791bdb [ChangeLog][Controls] To fix QTBUG-134903, when the right mouse button is pressed, we don't send a QContextMenuEvent if we can detect that a right-mouse click might already be handled by a TapHandler or a MouseArea to open a Menu. But we recommend that you stop opening menus that way: either rely on the built-in menus provided by TextArea and TextField, or use the ContextMenu attached property to replace or add menus to controls. In Qt 7 we plan to send the QContextMenuEvent without checking for handlers first. Fixes: QTBUG-134903 Task-number: QTBUG-132384 Change-Id: I1ef5387fbddeed4e6fc81d538683248a05d6e03f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix IME selection cursor updateJarkko Koivikko2025-10-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | The fix for QTBUG-94253 caused a regression in IME selection handling, where the selection would not move the cursor when a commit string was present. Cursor movement in this scenario is expected - for example, in the word re-selection feature of the Qt Virtual Keyboard. The user clicks inside the pre-edit text, and the VKB reselects a new segment up to the clicked position. This is implemented using an IME event with the commit string of the current pre-edit and the selection start attribute set to the clicked position. This patch refines the condition so that the original behavior of the selection start parameter is handled correctly when the IME event contains a commit string, with the exception of cases where an input mask is present in the text input. This preserves the input mask behavior fix from QTBUG-94253 while restoring correct selection handling. Pick-to: 6.10 6.8 6.5 Fixes: QTBUG-140400 Task-number: QTBUG-94253 Change-Id: I73d8ae32a1132d52cac9f39509ab2cbe922fa3d0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Frederic Lefebvre <frederic.lefebvre@qt.io>
* QQuickRhiItem docs: follow QRhiWidget docs wrt fixed sizeLaszlo Agocs2025-10-021-8/+22
| | | | | | Pick-to: 6.10 6.9 6.8 Change-Id: Ia212eabc2868714fc2065badedf12332c8a92642 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Initialize QQuickGradientStop position to zeroChris Adams2025-09-301-1/+1
| | | | | | | | | | | | | | | | | The documentation for GradientStop position says that its default value is zero. However, the member is not initialized, so its value is actually random. This can cause all sorts of problems (included corrupted rendering if the value happens to fall into a NaN range). [ChangeLog][QtQuick][GradientStop] The position property is now always initialized to 0.0; previously it was left uninitialized. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-140364 Change-Id: I5dbc83838fb4d2f1a46c34ae61e25bfe3853eb16 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Give ownership to qml instead of deleting the objectMorteza Jamshidi2025-09-221-1/+1
| | | | | | | | | | | | | | | after calling grabToImage in the callback it returns a qml wrapper around QQuickItemGrabResult object but then in the Event_Grab_Completed event it destroys the QQuickItemGrabResult object so the wrapper is also automatically destroyed after that. so in order for qml to be able to store the wrapper object and hold the result as long as needed we give the ownership of QQuickItemGrabResult to qml instead of deleting it. Pick-to: 6.10 6.8 Fixes: QTBUG-128483 Change-Id: Ibf9b9765e22ee8e0caf8b3646d86f8a4cf789ff1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Add QML docs for Window::startSystemMove and startSystemResizeDheerendra Purohit2025-09-221-0/+31
| | | | | | | | | | | | startSystemMove() and startSystemResize() are callable from QML but were undocumented. This change adds \qmlmethod documentation under the Window type. Pick-to: 6.8 6.9 6.10 Fixes: QTBUG-126558 Change-Id: Ib34a25fa3f9e12cc6fab85732c852a81448dcc4b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
* Set explicit default security level of all files with default securityJan Arve Sæther2025-09-17187-0/+187
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QQuickWindow: disconnect incoming signals in dtor to avoid assertDavid Faure2025-09-162-7/+13
| | | | | | | | | | | | | | | | | | | | qtbase commit 92a65fdac69d7773b114584f1637946622cf4f72 changed what happened when deleting a QWindow with child windows: they are now deleted earlier, from ~QWindow rather than from ~QObject. As a consequence, if the deletion of the child window triggers any signal (such as QSGRenderContext::invalidated), the parent window now receives it (while before, the code in ~QObject would disconnect the parent window from all senders). Fixed by explicit disconnects, using a std::array of QMetaObject::Connections, like in QSortFilterProxyModel for instance. Task-number: QTBUG-140170 Pick-to: 6.10 6.10.0 Change-Id: Id2c402d3121c8a3e6962cfed0afe1e90f5f14b3f Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QQuickTableView: Expose internal model changes via the model propertyUlf Hermann2025-09-152-1/+18
| | | | | | | | | | | | | | | If the delegate changes the model, those changes need to be visible in the "model" property of the view. To this end, use QQmlTableInstanceModel's model variant instead of the assigned one once it has been synchronized. The inner change signaling from the delegates to the view will be added in a separate change. Pick-to: 6.10 Task-number: QTBUG-139941 Change-Id: I1296fa2c886dad063b6b39defef56cb7faf1e943 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQuick: Simplify TableView model handlingUlf Hermann2025-09-133-24/+17
| | | | | | | | | Unwrap any QJSValues right away and eliminate a copy of the model. Pick-to: 6.10 Task-number: QTBUG-139941 Change-Id: I7f4a3ea97ae64cf0bb24aa032f8307c56bf7a597 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Properly wire up DelegateModel's modelChanged signalUlf Hermann2025-09-122-0/+16
| | | | | | | | | | If the model contents change we need to notify. This enables the signal propagation for Instantiator, Repeater, ListView, and GridView. Pick-to: 6.10 Task-number: QTBUG-139941 Change-Id: I384dcd296068ca7abfd1cad9fe662ae6e8938338 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Release section item when the corresponding view item removedSanthosh Kumar2025-09-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | The section item has not been removed or added to the section cache in all cases when the corresponding delegate item has been moved out of the visible area, either during flick or scroll. This happens in a case where the delegate item has been requested to be removed (as it goes out of the visible area) from the list view, but it's not released from the delegate model due to its caching mechanism. When an item is outside the visible area, releaseItem() is triggered, intended to free the item and its sections. The problem arises when releaseItem() calls QQmlInstanceModel::release(), which caches the item in the delegate model, but does not free the section. This prevents the section item from being released properly. This patch releases the section item whenever removeItem is triggered from the list view, which happens when the delegate item is moved out of the visible area. Fixes: QTBUG-137172 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ib7e78309e076e76750b03f3238a7501563a3962a Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QtQuick: Don't store a copy of the model in QQuickItemViewUlf Hermann2025-09-092-7/+14
| | | | | | | | | | | This is pure waste. We don't actually need the model since the QQmlInstanceModel is guaranteed to either be the model or hold its contents. Task-number: QTBUG-139941 Pick-to: 6.10 Change-Id: I09e898fbc8ea0c6baf854c179dbdd02b9440fabe Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQuick: Drop redundant members from QQuickRepeaterUlf Hermann2025-09-092-19/+15
| | | | | | | | | | | We only need to store the model once. The object stored that way is guaranteed to either be the model that was assigned or hold its contents. Task-number: QTBUG-139941 Pick-to: 6.10 Change-Id: Icec9fd9f756042c44a3e3189bf5c7ee4253b086f Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* TextInput: Port away from QQmlV4FunctionPtrFabian Kosmale2025-08-222-24/+4
| | | | | | | | | | There's no reason to add a dependency on V4 internals here, all we need are some default parameters. It's unclear why y is defaulted to 0, but we preserve that behviour. Change-Id: I19752547162cb5da4a2d193f782275dac13cb6ae Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* wasm: a11y - Send ObjectDestroyed event from quickitem destructorEven Oscar Andersen2025-08-141-0/+9
| | | | | | | | Also, turn QQuickAccessible items to invalid() once the QuickItem destructor starts. Change-Id: I8b6bc7d69ffaeb01eb453e75de2847efb869cbf2 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* DeliveryAgent: stop sending hovering mouse moves to grabberShawn Rutledge2025-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | 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>
* wasm: a11y - Implement ParentChanged eventEven Oscar Andersen2025-08-071-0/+7
| | | | | | | | | | | | | | | Implement the QAccessible::ParentChanged callback. Probaby not possible with a perfect implementation. What can reasonably be done is to issue ParentChanged on; QWidget::setParent, QWindow::setParent, QQuickItem::setParentItem. However calling these functions do not necessarily map 1:1 to QAccessibleInterface::parent(). One common reason for why the two hierarchies will diverge is because of the Accessible.ignored state Task-number: QTBUG-134923 Change-Id: Iaa8cfd3d65c0fac137c95434ec21176e7aea6699 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: Clarify Qt 6 hover behavior for Item::enabledDheerendra Purohit2025-08-051-6/+13
| | | | | | | | | | | | | In Qt 6, hover events may still be delivered when enabled is false to support tooltips. Updated the documentation to reflect this. Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-136598 Task-number: QTBUG-30801 Change-Id: I77fa717c18a76660c4f63b175c02cb8eef21d175 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Shawn Rutledge 🏖️ <shawn.rutledge@qt.io> Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
* Don't reuse invalidated distance field cacheEskil Abrahamsen Blomfeldt2025-08-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the fonts are invalidated e.g. because application fonts are cleared, there will be a bit of a round-trip where we reset all text components to rematch the fonts they use. Since the scenegraph nodes contain direct pointers to the distance field cache, we cannot delete the cache itself before the text has been reset and a new font has been matched. This caused an issue where an application font was unloaded and a new one was loaded instead. Since they both had the same virtual file name (":qmemoryfonts/0"), however, we would get the glyph cache for the old font when we were resetting the text with the old. Since the glyph indexes referred to the new font, we would end up with random glyphs in the text. The core problem was that the stale caches were still in the hash when the scenegraph was being reset. Instead, we start the sync by either deleting inactive caches or moving the active ones into a separate list. When the text items are reset, the hash is populated with new caches. When the sync is done, we flush the stale caches: Meaning that we delete the ones that are now no longer used. Pick-to: 6.10 Task-number: QTBUG-132108 Change-Id: Iae4bebdbd1acc34ff86a2f9f6f34fdd0d6cbac0e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Quick: Correctly expose more types to QMLFabian Kosmale2025-07-289-17/+15
| | | | | | | | | | | | | | | | | | | | | 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>
* Make it explicit that TableView's rowHeight and columnWidthProvider's can ↵Kai Köhne2025-07-241-4/+4
| | | | | | | | also return undefined Pick-to: 6.9 6.10 Change-Id: I074c817a9e29a385ba2b6b8ee32c06c84853ac99 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove ImHiddenText from password echoMode to enable virtual keyboardFrédéric Lefebvre2025-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | ImHiddenText when using the password echoMode makes virtual keyboard unaccessible if not tagged as accessibility tool, such as the gnome keyboard for example. Remove it to enable the use of virtual keyboard. This change does not have any effect on the text displayed and does not impact the security/confidential aspect when entering sensitive data in a textInput. Enable users who do not have access to a physical keyboard to still input senstive data, such as passwords, on their machine. Characters are shown as bullet dots with or without this patch, disregarding what the ImHiddenText flag might suggest. Fixes: QTBUG-88367 Change-Id: Ifd2a45e90ae022139a8ca89401b278e35bdc6a03 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Doc: link to TextInput's signals in more placesMitch Curtis2025-07-151-1/+15
| | | | | | | | | | | - If you're looking at one, chances are you want to know about the other ones. - We should be encouraging the use of these user interaction signals, otherwise users might just rely on textChanged. Pick-to: 6.5 6.8 6.9 6.10 Change-Id: I28071c8e8ab8fbb7746810364cca558e06e4884f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTextInput/Edit: ensure original context menu event is acceptedMitch Curtis2025-07-122-2/+6
| | | | | | | | | | | | | | | | We make a copy of the context menu event in order to map its position to cursorRectangle, but we forgot to set the accepted state back onto the original event. If we don't do this, showEditMenu (in src/plugins/platforms/ios/qiostextinputoverlay.mm) shows the built-in native text editing context menu (QIOSTextInputOverlay::s_editMenu) because it sees that the event wasn't accepted, resulting in both that and Controls' menu being shown. Amends 31ca3936d38ecbc3aa93411654099f5a45b16c4f. Fixes: QTBUG-138209 Change-Id: Iac001d9632af2f891337821720a372ec4833f173 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Propagate ignored shortcut key events in quick text edit to parentSanthosh Kumar2025-07-112-6/+9
| | | | | | | | | | | | | | | | | | | | | | | 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>