aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates
Commit message (Collapse)AuthorAgeFilesLines
...
* SearchField: Remove Key_Down wrapping for currentIndex and highlightedIndexDilek Akcay2025-07-151-2/+0
| | | | | | | | | | | This aligns with ComboBox, which doesn't wrap in either direction. Wrapping only on Down can lead to confusing behavior—like unintentionally jumping from the last to the first item. Home and End keys already provide fast navigation to list boundaries. Pick-to: 6.10 Change-Id: I94fe10862b972a87f4e416a5528069401ace556f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add FluentWinUI3 Style for SearchFieldDilek Akcay2025-07-141-5/+13
| | | | | | | Task-number: QTBUG-137318 Pick-to: 6.10 Change-Id: I30bb7161d23c9723842b4dd7ea346dd8a85fb6d9 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: Improve the documentation of effectiveScrollBarHeight/WidthDheerendra Purohit2025-07-111-4/+6
| | | | | | | | | | Clarify the effectiveScrollBarHeight and effectiveScrollBarWidth refer to the actual height and width used by visible scrollbars. Pick-to: 6.10 6.9 Fixes: QTBUG-120706 Change-Id: I1b9efd998922f4e6fa20564710266a012b9de600 Reviewed-by: Doris Verria <doris.verria@qt.io>
* Propagate modality to the non-native quick dialogsSanthosh Kumar2025-07-095-5/+26
| | | | | | | | | | | | | | | The non-native quick dialogs don't block input to the windows even after setting the modality as ApplicationModal/WindowModal. This is because non-native platform dialogs (QuickPlaform*Dialogs) didn't set modal to its respective window (QQuickPopupWindow). This patch fixes that issue by setting the modality to the non-native platform dialogs. Task-number: QTBUG-127605 Pick-to: 6.10 6.9 6.8 Change-Id: Idb3374e881766ae92adc0360c9b9af5c498dd6df Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Allow recursive layout of ApplicationWindowTor Arne Vestbø2025-07-081-8/+13
| | | | | | | | | | | | | The safe areas require recursive layouting of the ApplicationWindow menu bar, header, and footer (in particular). We added guards preventing that in 6dc95399797de4ec27984956df1fa587f4eb18ba, to fix QTBUG-87708, but the fix for that can be in QQuickLayout itself. Pick-to: 6.10 Task-number: QTBUG-87708 Change-Id: I0dc25d779fe76619591f35063826d50dff2e3d28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* SearchField: Add hover event handling for the indicatorsDilek Akcay2025-07-082-0/+34
| | | | | | | | | | Implemented hover move and leave event handling for the clear and search indicators. This allows dynamic background color changes based on the hover state on different styles. Pick-to: 6.10 Change-Id: I7d5d843ae5177a0aa6bab2e1ef6b1774e4331107 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* MonthGrid: address post-merge review feedback on timezone patchMitch Curtis2025-07-042-13/+8
| | | | | | | | | | | | | | Amends 57325020f65665d91e63dc300d674a8e8dc411f1. - Add a comment explaining why we store QQuickMonthGridPrivate::pressedDate as QDateTime now. - Store QDateTimes as local time to simplify things. - Make firstDateToDisplay const while we're here. Task-number: QTBUG-72208 Pick-to: 6.8 6.9 6.10 Change-Id: I9fbee12608855f30d229b4e3a4e78da5561feb44 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Change order of menuBar/header/footer to match visual orderJan Moeller2025-07-021-0/+9
| | | | | | | | | | | Currently, the tab navigation order is confusing as the footer is focused before the actual content of the ApplicationWindow. By adjusting the stack order, the tab navigation now matches the visual order. Fixes: QTBUG-137823 Pick-to: 6.8 6.9 6.10 Change-Id: Ibe6fe9305181fe7ed42d7f8ca2da689b1b6ccf41 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* MonthGrid: fix dates being incorrect for certain timezonesMitch Curtis2025-06-304-18/+44
| | | | | | | | | | | | | | | | | | | | | | When a QDate is passed to QML, it becomes to a JavaScript Date. As Dates are stored in local time, the QDates we were passing to QML had the potential to be one day off in certain timezones. For example: 00:00 UTC converted to UTC-8 is 20:00 the day before. Fix this by storing and providing dates as QDateTime so that we can give it a time of day that can't possibly result in a different day when converted to local time. It's fine to change the C++ API since it's private, and nothing will change for the type that users see, since they always get a Date. Add a SystemEnvironment singleton to QQuickControlsTestUtils (Qt.test.controls) to allow reading and writing environment variables from QML. Fixes: QTBUG-72208 Pick-to: 6.8 6.9 6.10 Change-Id: Idb4ab26568d8f1eddd5ab4cebe691e38173d02a9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Templates: Disconnect menu bar items when clearingUlf Hermann2025-06-271-1/+2
| | | | | | | | | | Otherwise we get change notifications for half-dead change listeners and subsequent crashes. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-137554 Change-Id: I194ca0f8c3a540b1bfc41fa969d0cd3b9e6c24e4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Improve imperative Menu API documentationAlexei Cazacov2025-06-271-7/+19
| | | | | | | | | | | This commit adds links to the topic about creating menu items, because this proccess is not straightforward. The commit clarifies the ownership of newly added menu items, sub menus, and actions. Fixes: QTBUG-134936 Pick-to: 6.10 6.9 6.8 Change-Id: Iea8fb74a759fcb4e0558aadba3cf0a22892f35f0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickAbstractButton a11y: Strip mnemonic for accessible nameMichael Weghorn2025-06-251-2/+7
| | | | | | | | | | | | | | | | | When setting the accessible name for a QQuickAbstractButton, don't include the ampersand ('&') character that denotes the mnemonic character, and don't escape literal ampersand characters by doubling them. Use the same helper function also used by widgets in qtbase to strip those extra ampersand characters. Add a corresponding test. Fixes: QTBUG-134208 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I0da58564ef028cda3c1cc1cecbaacbb4e9d92c17 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't delete component delegatesMitch Curtis2025-06-2510-3/+20
| | | | | | | | | | | | | | | | | This makes it impossible to e.g. swap between two delegates. Similar to 80f1186338bcf8c7d692b4fadfc46531c002c6b0 except for QQmlComponents. [ChangeLog][Controls][Important Behavior Changes] Old QQmlComponent delegates (not the item instances created by them) are no longer destroyed when a new one is set, as they are technically owned by user code. They will still eventually be garbage-collected as expected, assuming there are no references to them. Fixes: QTBUG-137777 Change-Id: Icbe6971727d684a266b12a0b41474397e536bfdc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickVelocityCalculator: Write reset() in terms of its default constructorSze Howe Koh2025-06-242-9/+1
| | | | | | | | It's a POD type after all, with a well-behaved default constructor Change-Id: I4df73013b81542d0481df6222df0261634b05772 Pick-to: 6.10 6.9 6.8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQuickVelocityCalculator: Remove unused QElapsedTimerSze Howe Koh2025-06-242-19/+9
| | | | | | | | | | This is a helper class for QQuickDrawer and QQuickSwipeDelegate. Neither of them make use of the default parameters in start/stopMeasuring(), so the QElapsedTimer is never used. Remove it to simplify business logic. Change-Id: I9dfda4ebffd076b3ec05de8a96702e507eb3fcd9 Pick-to: 6.10 6.9 6.8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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>
* Allow SelectionRectangle dragging if TableView doesn't flick via mouseShawn Rutledge2025-06-201-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting `interactive: false` on TableView is drastic (except perhaps in some mode that the user can enter somehow), but setting `acceptedButtons: Qt.NoButton` should be the default, to have flicking on touchscreens but avoid dragging by mouse. This is possible since cbc694491b8431fd3dcf82c3d17a17a06cbccebc (but the default was not changed, for fear of surprising users with a behavior change). So now QQuickSelectionRectanglePrivate::updateSelectionMode() allows dragging in either case, via all devices if the TableView is not interactive, or mouse-only if the flicking is touch-only. Long-press has so far been allowed to select only in the case when dragging cannot select. But if the TableView has interactive: true, then you can flick it on a touchscreen, regardless of how acceptedButtons is set, even though we may expect the user to select dragging the mouse. So now if `selectionMode: Auto` is declared, and touch flicking works, we allow the long-press to select, because otherwise there would not be a way to make a selection on a touchscreen. We should not consider `interactive: false` to be normal (unless the developer finds a need to disable scrolling in some unique modal use case that can be exited somehow). `acceptedButtons: Qt.LeftButton` is not a very useful setting either (even though it's still the default). The snippet is improved to illustrate, along with some drive-by's. Docs explain the behavior in more detail. Test coverage is added in the manual test and the autotest. Pick-to: 6.9 6.10 Task-number: QTBUG-97111 Task-number: QTBUG-132268 Change-Id: I912dbc7bf8de536794b5bdcc1269bf2860645de9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: link to Event Calendar example in MonthGrid's docsMitch Curtis2025-06-181-1/+2
| | | | | | | | Show how to use it in a more useful way. Pick-to: 6.5 6.8 6.9 6.10 Change-Id: Id7c1850007d2cb752b8ae4ad0f3cf01e04e322bd Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* QtQml: Hold QQmlTypeLoader in QV4::ExecutionEngineUlf Hermann2025-06-172-9/+6
| | | | | | | | | | | ... 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>
* a11y: Report QQuickControl localeMichael Weghorn2025-06-166-3/+94
| | | | | | | | | | | | | | | | | Implement support for QAccessible::Attribute::Locale (newly introduced in a previous qtbase commit) for QQuickControl objects by introducing a new QAccessibleQuickControl class that subclasses QAccessibleQuickItem and implements QAccessibleAttributesInterface to handle that one attribute. Add a corresponding unit test. Pick-to: 6.10 Task-number: QTBUG-137144 Change-Id: I3d94df920d5c965d6d803512e8e37234be79a8fc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix tooltip wrapping on macOS when using native windowMagdalena Stojek2025-06-131-1/+1
| | | | | | | | | | | | | | The initial window size is stored using qreal dimensions that were implicitly truncated when passed to QWindow::resize(int, int). This caused tooltips with multiple words to wrap unnecessarily on macOS. By explicitly using qCeil() when resizing the popup window, the calculated width and height are rounded up, preserving the intended layout. Fixes: QTBUG-130683 Pick-to: 6.10 6.9 Change-Id: I7305d02263108df72ff0c5cc81f5a7a829d9f755 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickSlider: Normalize near-zero values when setting slider valueDoris Verria2025-06-051-0/+3
| | | | | | | | | | | | Normalize near-zero values to 0.0 first before doing a fuzzy compare, as the latter may give false when comparing near-zero values to 0 eg: 0.0 and 1e-15. Fixes: QTBUG-134635 Pick-to: 6.8 6.9 6.10 Done-with: Jasuhan-Yoganathan <yasuhan.yoganathan@qt.io> Change-Id: I81474760dded319d41280c3ef8dbff340ae649e3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix null pointer dereferenceDilek Akcay2025-06-021-3/+3
| | | | | | | | | | | | | This changes fixes a potential null pointer deference by adding a null check for popup before accessing its methods. Previously, popup->findChild<QQuickItemView *>() was directly called without verifying that popup was non-null which could result in undefined behavior if popup had not yet been initialized. Pick-to: 6.10 Change-Id: Id1597dad7fb7c0ea8626d37fbc1541af60298f86 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Introduce SearchField for Quick ControlsDilek Akcay2025-06-013-0/+1161
| | | | | | | | | Add a new QQuickSearchField as part of the Qt Quick Controls to simplify implementing search functionality for lists of items. Task-number: QTBUG-126188 Change-Id: I634131161447616a2d66e7f301bd8a24adac2d7f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Popup/Overlay: Filter no events for non-popup children of OverlayOliver Eftevaag2025-05-302-33/+25
| | | | | | | | | | | | | | | | | | | | | Previously in 01de98703916ef485f8934485270478b90a524f6 we allowed MousePress and MouseRelease events to be passed to non-popup children of the overlay, but no other pointer event types. Allowing just MousePress and MouseRelease events seems arbitrary, since we should either tell users that they can put items on top of the overlay, or discourage this kind of use case altogether. Since 81e53a7e9cf7821c4e512c40671f56ec9b0c52fc we documented that this is a practice that should work normally, and thus it would make sense to allow all types of events to be sent to items that are on top of the overlay. Fixes: QTBUG-132644 Task-number: QTBUG-134545 Pick-to: 6.9 6.8 6.5 Change-Id: Iad29b9abb694bd0653da220f2922b294219396bb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Discourage users from abusing the overlay in unintended waysOliver Eftevaag2025-05-301-7/+12
| | | | | | | | | | | | | | | | | | | | | | Upon further investigation, it's clear that the overlay only exist in order to make popup's closePolicy and modality possible. Unfortunately, due to the various event filtering that happens in the overlay, stacking items on top of the overlay can sometimes cause the overlay to filter events that should be sent to items that are above it. Because of this, we shouldn't advice users to abuse the overlay in ways that it was never intended to be used. However, since there are no other solution to displaying items in front of the overlay, it might be equally problematic to remove the section entirely. Lets at least discourage users from doing this, while we come up with a more streamlined solution. Task-number: QTBUG-134545 Pick-to: 6.9 6.8 6.5 Change-Id: I2a20824996c6bdffd4b0fb76ebd8111c08effd06 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Make the overlay less confusing by documenting what's going onOliver Eftevaag2025-05-301-0/+28
| | | | | | | | | | | | Event handling in QtQuick is already quite complicated. It doesn't help that the overlay increases this complexity by filtering events in two separate steps. We'll hopefully be able to refactor some of this code in the future, but before we can do that, we need to understand how this works currently. Change-Id: I95bdd76d23e41a2293fa7dfdd401af980fc0be51 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Popup window: disable window "fitting" on WaylandOliver Eftevaag2025-05-261-1/+4
| | | | | | | | | | | | | | | | | | Wayland surfaces don't know where they are on the screen, which means that we can't rely on QWindow::mapToGlobal({0,0}) to get their position. It looks like we're supposed to use the wayland api to position popups. More specifically a xdg_positioner. Disable the part that doesn't work, until we figure out a proper solution. QTBUG-99618 tracks necessary changes that neeeds to be made to qtbase and the wayland platform window, before we can fix it in qtdeclarative. Fixes: QTBUG-135158 Pick-to: 6.9 6.9.1 6.8 Change-Id: I9af0250f77bddc0c4f09bb028cd5105d4548a061 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Doc: Remove transparent backgrounds from calendar imagesKai Köhne2025-05-223-6/+6
| | | | | | | | | | | | These don't work well in dark mode: https://doc.qt.io/qt-6/qml-qtquick-controls-monthgrid.html While at it, also convert to webp. Pick-to: 6.9 Change-Id: I9b0cd1cb479145c17f37533ade8b09564d2f5534 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Remove transparent backgrounds from wireframe imagesKai Köhne2025-05-214-4/+4
| | | | | | | | These don't work well in dark mode. Also, convert to webp while at it. Pick-to: 6.9 Change-Id: Ie210c7cc03f742f2cfbd5af3d3b692309ccf6aae Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Fix Linking issuesTopi Reinio2025-05-201-2/+2
| | | | | | | | | | | | | | | | - Fix linking to `QtQuickView` Android class - Fix incorrect link target to section - Fix \sa link to QLocale::createSeparatedList() - Remove link to undocumented header `qqmlregistration.h` - Replace link to non-existent QML type HeaderViewDelegate with actual type name(s). - Fix links to (Horizontal|Vertical)HeaderView::delegate property, as the property is documented in the base type. - Remove \sa links to private member QSGTextNode::doAddTextDocument() Pick-to: 6.9 Change-Id: I3bab7155f8d73af6d51f8cfe890ece6d31671f1d Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* ComboBox: fix crash when setting modelMitch Curtis2025-05-151-12/+31
| | | | | | | | | | | | | | | | | | In certain use cases, setting a ListModel that's created by a Loader can cause a heap-use-after-free. Account for this by storing a QPointer to the model if it's QObject*, and checking the validity of that before casting. I wasn't able to reproduce this in an auto test. Rename some local variables while we're at it, to improve the readability of the code. Fixes: QTBUG-136672 Pick-to: 6.8 6.9 Change-Id: I84bbf21b37fb5675c931600ef8ea47365cceb09a Reviewed-by: Christopher Adams <chris.adams@qinetic.com.au> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Menu: force contentItem ListView layout before starting enter transitionMitch Curtis2025-05-131-0/+17
| | | | | | | | | | | | | | | | | | | | | | Enter transitions may want to animate the Menu's height based on its implicitHeight. The Menu's implicitHeight is typically based on the ListView's contentHeight, among other things. The docs for ListView's forceLayout function say: "Responding to changes in the model is usually batched to happen only once per frame." As e.g. NumberAnimation's from and to values are set before any polishes happen, any re-evaluation of their bindings happen too late, and the starting height can be out-dated when menu items are added after component completion (QQuickItemView::componentComplete does a layout, so items declared as children aren't affected by this). To account for this, this patch forces a layout before the transition starts, if necessary. Fixes: QTBUG-136256 Pick-to: 6.5 6.8 6.9 Change-Id: I1cc912347b774369b3542f0d32c654ae5615b97a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qquickpopup: Minimize overlay calls in finalizeExitTransitionJarkko Koivikko2025-05-091-23/+19
| | | | | | | Pict-to: 6.9 Change-Id: I4a3147a11d36ed6db94b454581ee4dee0a8730e4 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qquickpopup: Guard finalizeExitTransition against overlay nullptrJarkko Koivikko2025-05-091-2/+1
| | | | | | | | | | Add a nullptr check in finalizeExitTransition to prevent potential dereferencing of a null pointer when destroying a window. Pick-to: 6.9 Change-Id: I05b8e266df93df873af96c6f5692b2fd519d3bbf Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qquickpopup: Clear stale last active focusJarkko Koivikko2025-05-082-2/+15
| | | | | | | | | | | | | | | | | | | | Non-modal popups were saving lastActiveFocusItem but only clearing it if *they* had focus when closing. If focus moved away while open, the stale focus stuck around and got restored on the next close. Introduce a savedLastActiveFocusItem flag in QQuickPopupPrivate. Set it when we record lastActiveFocusItem in prepareEnterTransition(), and in finalizeExitTransition() only clear the overlay's saved focus if this popup actually set it. For stackingOrderPopups, add an additional check which avoids setting active focus to a popup which has already gained it during open. This allows lastActiveFocusItem logic to take place instead. This scenario happens with menu popups using exit transition (e.g. Material style). Pick-to: 6.9 Change-Id: I81caf1b5e647b3794ac8d03888534501c771ae07 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qquickpopup: Capture activeFocusItem before reparenting popupJarkko Koivikko2025-05-081-9/+8
| | | | | | | | | | | | | | | | Previously, prepareEnterTransition would reparent the popupItem before saving window->activeFocusItem(), which could shift focus into the popup and cause the saved focus to fall back to the window contentItem. In particular, during reparenting focus may be set if user code calls forceActiveFocus, for example, in the onVisibleChanged handler. The activeFocusItem is now captured before reparenting and stored in lastActiveFocusItem. Pick-to: 6.9 Change-Id: I6f4691e871661b6ba66b43ed720dc771a65ae3ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix broken hover in ApplicationWindow's backgroundMitch Curtis2025-04-234-82/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8fb643f6d63813a5a8df5e829e4ddeb357e0348d fixed ComboBox not being hoverable by setting QQuickApplicationWindowPrivate::control's hoverEnabled property to true. By doing so, it ensured that only that control and its parent chain could get hover events, breaking hover for e.g. background. The correct fix is to adapt QQuickControlPrivate::calcHoverEnabled to skip the property("hoverEnabled") == true check for QQuickApplicationWindowPrivate::control, resulting in it falling back to the global checks. - Remove code added in 8fb643f6d63813a5a8df5e829e4ddeb357e0348d. - Move QQuickApplicationWindowPrivate declaration into its own header so that code outside the .cpp file (qquickcontrol.cpp, in this case) can use it. - Document behavior of hover flags in void QQuickItem::setAcceptHoverEvents. - Move the check done in tst_QQuickControl::hoverEnabledDefault() into the new tst_QQuickApplicationWindow::hoverInBackground() since they're closely related. - Add initial starting position argument to PointLerper's constructor since it wasn't previously possible to set it. - Remove unused headers in qquickapplicationwindow.cpp. Fixes: QTBUG-133886 Fixes: QTBUG-136031 Pick-to: 6.9 Change-Id: Ic32f902be6433c1c9dc9f4610c5715ce1537e605 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Internally document QQuickApplicationWindow's item hierarchyMitch Curtis2025-04-181-3/+15
| | | | | | | | | | | This changed after 83d90845527799c78366c2b89e9c14bc35e88695. It's not documented anywhere and is difficult to follow when going only by the code. Task-number: QTBUG-136031 Pick-to: 6.9 Change-Id: Ia9a12191bb19d8dd23d142a78dbe573a4d2e3007 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix compilation when quicktemplates2_hover feature is disabledJuha Vuolle2025-04-171-0/+2
| | | | | | | Pick-to: 6.9 6.8 Fixes: QTBUG-135946 Change-Id: Ie22da6a87d3cb43601ae9df30cb99262a8f6b479 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QQuickMenu: fix infinite loop with Action shortcut in nested sub-menusMitch Curtis2025-04-161-1/+6
| | | | | | | | | | 51ad5091929c7f2c4bab94fab9fa1c20996a6efa forgot to set parentMenu in the loop. Fixes: QTBUG-135965 Pick-to: 6.5 6.8 6.9 Change-Id: I56ad611a6dd6e9f978ce3da5cc28e02d8f2b1a1a Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Doc: improve "Context Menus" section of Menu's documentationMitch Curtis2025-04-141-2/+2
| | | | | | | | | | | - Simplify code snippet. - Simplify note about desktop platforms. Task-number: QTBUG-134903 Pick-to: 6.9 Change-Id: Ibc0db63fd3f0692c42d0b2e6685d4437850cb5a8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Don't overwrite Accessible.description when it was explicitly setJan Arve Sæther2025-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | QQuickTextAreaPrivate::accessibilityActiveChanged() unconditionally set the Accessible.description to it's placeholder text whenever the accessibility became active (also when it became inactive, but it's beside the point). However, this meant that any explicitly set description would be overwritten each time accessibility became active. This was also the case whenever placeholderText got changed. Follow the same pattern as the Accessible.name property: Add an API for setting an implicit description: setDescriptionImplicitly(). This is similar to setNameImplicitly(). If there is already an explicit description set, setDescriptionImplicitly() will do nothing. Otherwise, it will set the description. Thanks for Even Oscar Andersen <even.oscar.andersen@qt.io> for reporting the bug Pick-to: 6.9 6.8 Task-number: QTBUG-135164 Change-Id: I8d63c70225c5a46e5e3df7f3359c87fca399f530 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix compilation when draganddrop support is disabledJuha Vuolle2025-04-101-0/+4
| | | | | | | | | | | | | | | | | | | | When Qt is configured with -no-feature-draganddrop, the quick_draganddrop feature gets disabled too. Consequently many dialog files are then omitted from the build, see src/quickdialogs/quickdialogsquickimpl/CMakeLists.txt. As a result, some dialogs and templates that include and use these files/classes unconditionally, fail to compile. This commit adds same feature guards to these includes/uses. In addition this commit adds the few missing 'drag' feature guards in QQuickVerticalHeaderView as well as adds appropriate feature guards to autotests. Pick-to: 6.9 6.8 Fixes: QTBUG-135740 Change-Id: If1688a3cd8f52918088a8c586d54ccf09cb08890 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Close all other Menus when showing non-sub-menuMitch Curtis2025-04-091-8/+40
| | | | | | | | | | | | | | | | | | | | | | This fixes the linked bug, but also generally makes sense, as there shouldn't be a use case where two menus are open at once. Adjust the documentation to reflect the current state of context menus and use best practices. [ChangeLog][Controls][Important Behavior Changes] All non-sub-menus are now closed when a menu is opened. This is to fix an issue (QTBUG-134903) where duplicate menus are shown when opening a custom non-ContextMenu on a text editing control like TextField or TextArea. This means that rather than two context menus incorrectly being opened, an extra one will briefly be visible before immediately being closed. For information on how to avoid this, please see the "Context menus" section of Menu's documentation. Fixes: QTBUG-134903 Pick-to: 6.9 Change-Id: I158295b72176935c2dc8072a72a4df66678be824 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* SwipeDelegate: Compare against QLastCursorPosition for default mouse posShawn Rutledge2025-04-011-2/+3
| | | | | | | | | | | | | | | | | 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>
* Doc: move Menu's detailed description snippets into snippet filesMitch Curtis2025-03-241-65/+4
| | | | | | | | | | Ensure that they're auto-tested, which would prevent issues like QTBUG-128520 when combined with failOnWarning, which will be done in a follow-up patch. Pick-to: 6.8 6.9 Change-Id: Ib773dd2780e8ffe0a554852bd20ef20a4ab65c1a Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Button: don't allow pressing if already pressedShawn Rutledge2025-03-191-0/+2
| | | | | | | | | | | | | | Pressing one Button and then another, on a touchscreen, should not cause either Button to emit pressed() twice. tst_button.qml's test_multiTouch() now counts the pressedChanged and pressed signals separately. Pick-to: 6.5 6.8 6.9 Fixes: QTBUG-122043 Change-Id: I2f353ebc29900f9cfba5e71425022473d3a32a26 Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* SwipeDelegate: check for believable mouse pos rather than qInfShawn Rutledge2025-03-191-2/+2
| | | | | | | | | | | | | | | | 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>
* QQuickPopupItem: Set tabFence to be true by defaultDoris Verria2025-03-173-2/+7
| | | | | | | | | | | | | | | | | | | | | | | The tabFence property should not be dependent on popup modality as it was introduced in 611422b5968ceac6cfba034116a3d1e107d8e2df. The popup item should by default act as a tabFence, meaning that it should not allow tab focus navigation in and out of a popup, no matter its modality. However, certain kinds of popups, such as the drawer, where it makes sense to tab focus outside, should override the tabFence property to be false. In that case, keep the old behavior that makes this dependent on the modality. Reverts 611422b5968ceac6cfba034116a3d1e107d8e2df and e9555f6de625a2fffdfb032a7c293f842b269f9a [ChangeLog][QtQuick][Controls][Popup] The popupItem always acts as a tab fence, preventing tab focus navigation in and out of the popup, except when the popup is a Drawer, in which case this behavior depends on the drawer's modality. Fixes: QTBUG-132763 Change-Id: I99d250333c98354429943ca6b3267482b2152b47 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>