aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates
Commit message (Collapse)AuthorAgeFilesLines
* Docs: fix various linksVolker Hilsheimer7 hours1-2/+2
| | | | | | | | | Use the correct syntax for the scope of the link target for Qt Quick types. Pick-to: 6.11 Change-Id: Ica96c1b736a9b8ddd29a63c21d6a7094bd598ed8 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: Remove stale version information from Qt Quick ControlsAlexei Cazacov5 days3-5/+4
| | | | | | | Fixes: QTBUG-141045 Pick-to: 6.11 6.10 Change-Id: Ieb8882f4f07c0893095481e7f9104069cf92a389 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* a11y: Use Grouping a11y role for QQuickDialogButtonBoxMichael Weghorn11 days1-1/+1
| | | | | | | | | | | | A dialog button box is not a list of page tabs, but it groups the buttons, so use QAccessible::Grouping for the accessible role like the QDialogButtonBox equivalent in qtbase does (see QAccessibleDialogButtonBox). Fixes: QTBUG-141734 Pick-to: 6.10 Change-Id: I5ce474fbf6902c7e565f86307d00a0b8bdc63abd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Qt Quick Controls: add DoubleSpinBoxXavier BESSON11 days6-731/+1496
| | | | | | | | [ChangeLog][Controls] Added DoubleSpinBox. Fixes: QTBUG-67349 Change-Id: Icb2f02162825daf74778de725f80af63874a5d16 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickStackView: don't convert QUrl -> QString -> QUrlAhmad Samir2025-11-281-1/+1
| | | | | | Pick-to: 6.10 6.8 6.5 Change-Id: I1bd30625e474ea4e36c6fb252afbbe2cd9e17162 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Private API for giving an Item its own OverlayPaul Olav Tvete2025-11-287-22/+45
| | | | | | | | | | | | | | | | | | | 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>
* Doc: Add alternate text for Qt Quick and Qt Quick Controls imagesJerome Pasion2025-11-2657-11/+123
| | | | | | | | | | Alternate text (alt text) improves the documentation experience for screen readers and for other accessibility tools. Pick-to: 6.9 6.10 Task-number: QTBUG-135120 Change-Id: I975c3de11f893882fb9a27218079f244bd38a622 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix CalendarModel month count calculationJoni Poikelin2025-11-261-1/+1
| | | | | | | | | | CalendarModel used previously set from and to values to calculate the range and thus the count wasn't ever up to date. Fixes: QTBUG-141883 Pick-to: 6.10 6.8 Change-Id: Id3ef60810d2e8ebfcc060307e6d17cfca379cd78 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Dialog(ButtonBox): Prioritize popupItem subFocusItem over buttonBoxOliver Eftevaag2025-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a followup to e323e508b61ce0a2615c9c8e8fbf897e27965173. In cases where a Dialog has an item with explicit focus, e.g: ``` Dialog { Button { focus: true text: "Foo" } footer: DialogButtonBox { standardButtons: DialogButtonBox.Ok } } ``` Then the "Foo" button should get focus, since it's explicitly set in QML. 4d1753b95f0343a68f80a1b482b8ab9a0397fecb changed this behavior to instead always give the buttonbox focus. If focus isn't explicitly set elsewhere, it should be fine to give it to the buttonbox. However, doing so unconditionally would be a significant behavior change that would break lots of user projects. Add a precondition to verify that the popupItem doesn't have a subFocusItem, before considering whether or not to give focus to the buttonbox. As a drive-by, also just call setFocus() instead of forceActiveFocus(). Both functions work for our purposes, so might as well use the less extreme option. Amends e323e508b61ce0a2615c9c8e8fbf897e27965173 Change-Id: Iea72f162669159082386966a1d9419c64abb7302 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Dialog: Don't give buttonBox focus when empty or buttons are disabledOliver Eftevaag2025-11-181-2/+9
| | | | | | | | | | | | | | | | | Focus behavior was changed in 4d1753b95f0343a68f80a1b482b8ab9a0397fecb to give the buttonBox focus when a dialog is opened. This will fundamentally conflict with user projects that manually set the focus property. Further discussion will be needed to arrive on a good solution for when the focus property is manually set. For now, we can at least make sure that the new focus behavior is limited to cases where the buttonBox actually contains buttons (aka, not empty), with at least one of them being enabled. Fixes: QTBUG-141998 Change-Id: I704e6a707f5b579e5f4de7b6197abc2fc5dfdf3e Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
* Account for icon color being set to transparentMitch Curtis2025-11-182-5/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQuickAbstractButtonPrivate::updateEffectiveIcon we need to resolve the icon's color so that QQuickIconLabel knows which of defaultIconColor and icon.color should win. In both QQuickAbstractButtonPrivate::updateEffectiveIcon and QQuickAction::setIcon, we need to unconditionally set the icon and be more strict about when we return early. This fixes the case where setting "transparent" as the icon color wouldn't result in the original image's colors being used, but would instead result in the style's default icon color: Button { text: "Original icon color" icon.source: "heart.svg" icon.color: "transparent" } Button { text: "Original icon color (action)" action: Action { icon.source: "heart.svg" icon.color: "transparent" } } Task-number: QTBUG-87459 Change-Id: Ic490e3b37a8174b8c034b84a1ad551a78088e44d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix QQuickIconLabel action icon color being overridden by style defaultMitch Curtis2025-11-185-24/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Styles need a way to set the default icon color for controls. Until now, that was done like this: icon.color: "tomato" contentItem: IconLabel { icon: control.icon } This breaks the use case of e.g. an Action that sets its own icon.color, because the icon property of the control always takes precedence (see 146bc9517c56feda4eba34282d3cc53bd47b6267). This patch adds a defaultIconColor property to IconLabel, which allows styles to specify a color without overriding any potential action's icon: contentItem: IconLabel { icon: control.icon defaultIconColor: "tomato } If icon.color was explicitly set, it is used instead. This does mean that overriding the contentItem will result in the icon color being lost, but that is already the case for style customizations in general. All controls that set icon.color and using IconLabel to display their icon are affected and are therefore adapted: Button, CheckDelegate, DelayButton, ItemDelegate, MenuBarItem, MenuItem, RadioDelegate, RoundButton, SwipeDelegate, SwitchDelegate, TabButton, ToolButton. Add FlowPane to the shared folder of the baseline test and use it in the tests that we touch. This fixes two issues: - Using Pane as the background fixes text being invisible for some styles. - Using Flow provides the most space-efficient layouting of items now that we have more than would fit in the old layout. Task-number: QTBUG-87459 Change-Id: I455ce7202a46b7cfa7545650574e48ad72796675 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* quicktemplates: fix build with -no-feature--quicktemplates2-containerNick Shaforostov2025-11-152-2/+17
| | | | | | Pick-to: 6.10 Change-Id: Ie2d73970be8ca81c1dc755a8684f8067c83f56bc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* DialogButtonBox: add properties for setting a default buttonOliver Eftevaag2025-11-145-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick Controls lacked the ability for setting a default button in a dialog button box. This is something that we support in QtWidgets, and it makes sense to allow dialogs with a DialogButtonBox set as the footer to decide if a particular button should be default, and have focus when the dialog is opened. With this patch, we're introducing two different ways for selecting a default button. The first is the usage of the DialogButtonBox::defaultButton property, which works like this: ``` DialogButtonBox { defaultButton: Button { text: qsTr("Ok") } Button { text: qsTr("Cancel") } } ``` In the snippet above, the Button that is set as default should both be highlighted, and be the sub focus item of the DialogButtonBox. However, since the standardButtons property can be used to dynamically create buttons on the fly, we also needed an alternative way for picking a default button. In cases where standardButtons is being used to create buttons in the DialogButtonBox, the new defaultStandardButton property can be used: ``` DialogButtonBox { standardButtons: DialogButtonBox.Yes | DialogButtonBox.No defaultStandardButton: DialogButtonBox.Yes } ``` Something worth noting, is that the DialogButtonBox's contentItem is typically a ListView. ListView have the ItemIsFocusScope flag set, meaning that we need to give focus to both the ListView, and the default Button. In addition, the FontDialog and ColorDialog will now make the Ok button default, and give it focus when the dialogs are opened. The FileDialog and FolderDialog will continue to give the ListView focus, since that's IMO more user friendly. The MessageDialog will need new API to take full advantage of this new feature, which will be introduced later. [ChangeLog][DialogButtonBox] The DialogButtonBox now has two new properties, defaultButton and defaultStandardButton. When one of these properties are being used, a button set as default will be highlighted and receive activeFocus whenever the DialogButtonBox gets focus. If a DialogButtonBox is assigned as a Dialog's footer, it will also get focus when the Dialog is opened. This means that a Dialog with a DialogButtonBox as its footer, will give focus to a default button when opened. If both of these properties are unset, the first button with the AcceptRole will get focus, but it will not be highlighted. Fixes: QTBUG-58246 Fixes: QTBUG-139352 Change-Id: Ic083410184dd63e0e790694f782a7a98c1dc8b6e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickSelectionRectanglePrivate: port away from 3-arg connectAhmad Samir2025-11-091-8/+13
| | | | | | | | Pick-to: 6.10 Task-number: QTBUG-116296 Change-Id: Ic408673f79e12708c1594577cdeb37898caf2cb6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ScrollBar: ensure cleanup functions are called regardless of flickableMitch Curtis2025-11-071-6/+14
| | | | | | | | | | | | Otherwise the old scroll bar can be visible in certain situations. Extends 908aa77d16e00f2bccc0ddae0f8b61955c56a6a1. Amends bb2a6c61777e2500fa00710c8bb752fa7b99f079. Fixes: QTBUG-141229 Pick-to: 6.8 6.10 Change-Id: I5c8a02f90e68c42d21078b945cc1ea0c84066635 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Document native menu support for ContextMenuMitch Curtis2025-11-061-0/+8
| | | | | | | | Task-number: QTBUG-134798 Task-number: QTBUG-141556 Pick-to: 6.9 6.10 Change-Id: Ib2c674c96b21b7e93c0c9498df722cce5100d1ee Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* RangeSlider: keep values integer if everything is integerMitch Curtis2025-11-064-8/+62
| | | | | | | | | | | | | | | Based on 42687caf7bc7496b838995f3fa68194ca8323da3. If a user uses integer values for stepSize, from and to, they most likely want the actual values of the handles to be integers, too. Detect this condition, and store it in a new boolean member. If the condition is met, we round the value in valueAt() (which, due to floating point math, might not be an exact integer). Fixes: QTBUG-141090 Pick-to: 6.8 6.10 Change-Id: If9507534db8fceb113e7426b5d46c6a023919d66 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* a11y: Report QQuickScrollBar orientationMichael Weghorn2025-11-032-0/+19
| | | | | | | | | | | | | | In QAccessibleQuickScrollBar, support QAccessible::Attribute::Orientation newly introduced in qtbase. This makes the QQuickScrollBar orientation available on the accessibility level. Task-number: QTBUG-140769 Change-Id: I5d2790ec065196eeb5cae3cfd267a375785d8edd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
* a11y: Report + allow modifying QQuickScrollBar positionMichael Weghorn2025-11-035-2/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce QAccessibleQuickScrollBar as the a11y implementation for QQuickScrollBar and override the base class implementations for the QAccessibleValueInterface methods to report and allow setting the position of the scroll bar. (The base class implementation would always use meaningless values of 0.0.) "Normalize" the valid values for QQuickScrollBar::position which range from 0.0 to 1.0 - QQuickScrollBar::position (see [1]) to a range of 0.0 to 100.0 for the accessible interface. In QQuickScrollBarPrivate::setPosition, send a QAccessibleValueChangeEvent when the value changes, so assistive technology are notified of the new value. This e.g. ensures that the value shown in Accerciser's "Interface Viewer", section "Value" gets updated when scrolling happens. [1] https://doc.qt.io/qt-6/qml-qtquick-controls-scrollbar.html#position-prop Fixes: QTBUG-140673 Task-number: QTBUG-139833 Change-Id: I4333d91a70c6056424fe1e09cb075cf6ca7266e2 Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* a11y: Make QQuickTextInput accessibleMichael Weghorn2025-10-302-46/+4
| | | | | | | | | | | | | | | | | | 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>
* Doc: Fix links to Qt Quick and Qt Quick ControlsDavid Boddie2025-10-278-33/+34
| | | | | | | | Making links explicit prevents QDoc from auto-linking when not desired. Marking QtQuick as code when relevant also prevents auto-linking. Change-Id: Ib187cb94f59a418c77ef2931999f634e557c8200 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* a11y: Fix TextField so that Accessible.description returns the correct valueEven Oscar Andersen2025-10-271-2/+2
| | | | | | | | | | | When setting an implicit description (from placeHolderText) it would unconditionally overwrite any explicitly set Accessible.description (even if the placeHolderText was empty), causing Accessible.description to be empty even if it was previously explicitly set to a non-empty value. Change-Id: Ice3f81dba1a4c188be71856860e7d6b3a0cf9f95 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: Replace text with \since commandsDavid Boddie2025-10-222-2/+2
| | | | | | | | QDoc is able to refer to whole property groups using \since commands, so we can replace hard-coded text with those. Change-Id: I712e24cac48190ba805795e0d8e4abc18732b785 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QQuickPopupPrivate::handleTouchEvent() use QEventPoint::scenePosition()Sze Howe Koh2025-10-212-4/+4
| | | | | | | | | | | | | | | QQuickPopupPrivate::handleMouseEvent() has already converted from `item->mapToScene(point.position())` to `point.scenePosition()`: 1. fe86b0fda7bcce099a0bca08e6925e89efc634c4 2. e481f1c414d7c243efabe4215b1865c616d25ce0 Give QQuickPopupPrivate::handleTouchEvent() the same treatment to fix swiping open Drawers by touch. Change-Id: Ieb4b8f0677043f09771e5700c8d441cc90d7fa75 Fixes: QTBUG-132914 Pick-to: 6.10 6.8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickOverlay: translate touch events that circumvent the deliveryagentOliver Eftevaag2025-10-201-1/+3
| | | | | | | | | | | | | | | | 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>
* a11y: Change role of QQuickPage to Pane from PageTabEven Oscar Andersen2025-10-161-1/+1
| | | | | | | | | PageTab is really like a button, or something you can click on to display the selected tab. It is not the contents of that tab. Change-Id: I4ddd87541512a3712d9ca65e7336c8d9018d1023 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* a11y: Send missing QAccessible::ObjectShow event for Qt Quick ControlsJan Arve Sæther2025-10-134-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before sending the QAccessibleEvent QAccessible::ObjectShow event from QQuickItemPrivate::setEffectiveVisibleRecur() we checked if QQuickItemPrivate::isAccessible was set. For e.g. Button, isAccessible wasn't set by default: This was because isAccessible was only set as a response to that an Accessible attached property was assigned to the item. Therefore, when a Button was shown it could end up not sending the QAccessible::ObjectShow event. This problem was first found on Button, but after more investigation, we have found that the same problem applies to: * BusyIndicator * Button * ComboBox * Dial * Label (without a text) * ProgressBar * RangeSlider * RoundButton * Slider * TextArea * TextField The fix is to explicitly enable accessibility by calling QQuickItemPrivate::setAccessible() on *all* Qt Quick Controls, since they are all supposed to be accessible. Change-Id: If4fa050149a31bf2baffa208716341d21631c042 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Docs: fix missing SpinBox controlEren Bursali2025-10-091-1/+1
| | | | | | | | | | | Adding missing "\ingroup qtquickcontrols-input" to "qquickspinbox.cpp" so it will be displayed in "https://doc.qt.io/qt-6/qtquickcontrols-index.html". Fixes: QTBUG-140922 Pick-to: 6.10 Change-Id: I12fa3b6c4d74964173d32f594b0fe323dd3487f9 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Assert that overlay isn't nullKaj Grönholm2025-10-091-0/+1
| | | | | | | | | We expect overlay to always exist at this point. Pick-to: 6.10 6.8 Task-number: QTBUG-139269 Change-Id: I51d986757398be3b4eb246772f37394bc9a443a8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPane: disconnect signals in destructorMitch Curtis2025-10-071-0/+6
| | | | | | | | | | | It seems that the private connection isn't automatically disconnected in time to avoid a sporadic crash when destroying Pane for native styles. Fixes: QTBUG-140838 Pick-to: 6.8 6.10 Change-Id: I01e24b33d532d4c818f7a1dd9da7c03bcae503fd Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* SearchField: Keep currentIndex at -1 until user explicitly selectsDilek Akcay2025-10-021-19/+14
| | | | | | | | | | | | | | | | | | Until now, currentIndex was assigned to different values on different actions, like to 0 on model changes, or to the index of the highlighted index according to the arrow key actions. These caused unexpected behavior so the following changes were made: - Removed setting to 0 when model is set in the beginning. - Reset currentIndex to -1 on any user edit(typing/deleting) - Disabled arrow key interactions on currentIndex Now currentIndex only changes whether the user clicks an item in the popup or presses Enter on a highlighted item. Pick-to: 6.10 Change-Id: Ib1a991c87a767fe436b4b025a26834871401ca4b Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* StackView: don't load new items if QML engine is nullMitch Curtis2025-10-015-61/+109
| | | | | | | | | | | | | | | | | | | | | | | | In the linked bug report, a Loader is deactivated after an Image within it has started loading. A slot was connected to the statusChanged signal of the Image, which calls replace(). This caused an assertion failure because the StackView's QML engine was null. Note that it's not enough to check if the QML context is non-null, because it still is at that point. There isn't an easy way to check for this in one place in QQuickStackView, let alone in user code, so we need a lot of engine checks. Add a C++ test for StackView, as I wasn't able to get it to crash with a QML-only test. For now we only need to test the Basic style, since most styles don't provide anything too interesting or complex for StackView. Fixes: QTBUG-140018 Pick-to: 6.8 6.10 Change-Id: I53ba016bf44c46b7734b0b2daeeb62177f9067db Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* SpinBox: accept touch eventsMitch Curtis2025-10-011-6/+14
| | | | | | | | | | | | | | | | If an item doesn't call setAcceptTouchEvents(true), touch events will be converted to mouse events. This mostly worked, except for hover, where the touch events don't translate in the way that we needed them to. Set this for SpinBox in the same way that 3c2eab829df900a4bcc308fe0d8d5a87cd8f56a3 did for other controls. Fixes: QTBUG-140481 Pick-to: 6.5 6.8 6.9 6.10 Change-Id: I18751f86c1af1aea019f441a90af443cd88dea8b Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Menu: prioritize parentItem's window as transient parent for native menusOliver Eftevaag2025-09-281-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformMenu::showPopup() takes a QWindow ptr as its first parameter, which may or may not be used, depending on the platform. But usually this becomes the 'transient' parent window for the menu. This QWindow ptr is chosen as the first element in the list returned from QGuiApplication::topLevelWindows(), and there's no guarantee that it won't be empty. On macOS, the following snippet would reproduce a crash, when opening the menu and pressing Command+Q: ``` Button { text: "Open menu" onClicked: contextMenu.open() Menu { id: contextMenu popupType: Popup.Native title: "File" MenuItem { action: Action { text: "Open" } } } } ``` This would be the backtrace: ``` 4 qAbort() 5 void qt_maybe_message_fatal<QString&>(QtMsgType, QMessageLogContext const&, QString&) 6 qt_message(QtMsgType, QMessageLogContext const&, const char *, char *) 7 QMessageLogger::fatal(const char *, ...) const 8 qt_assert(const char *, const char *, int) 9 QList<QWindow *>::first() 10 QQuickMenuPrivate::setNativeMenuVisible(bool) 11 QQuickMenu::setVisible(bool) 12 QQuickPopup::close() 13 QQuickPopup::setParentItem(QQuickItem *) 14 QQuickPopupPrivate::itemDestroyed(QQuickItem *) 15 QQuickMenuPrivate::itemDestroyed(QQuickItem *) 16 void QQuickItemPrivate::notifyChangeListeners<void (QQuickItemChangeListener:: *)(QQuickItem *), QQuickItem *>(QFlags<QQuickItemPrivate::ChangeType>, void (QQuickItemChangeListener:: *&&)(QQuickItem *), QQuickItem *&&) 17 QQuickItem::~QQuickItem() 18 QQuickControl::~QQuickControl() 19 QQuickAbstractButton::~QQuickAbstractButton() 20 QQuickButton::~QQuickButton() 21 QQmlPrivate::QQmlElement<QQuickButton>::~QQmlElement() 22 QQmlPrivate::QQmlElement<QQuickButton>::~QQmlElement() 23 QQmlPrivate::QQmlElement<QQuickButton>::~QQmlElement() 24 QObjectPrivate::deleteChildren() 25 QObject::~QObject() 26 QWindow::~QWindow() 27 QQuickWindow::~QQuickWindow() 28 QQuickWindowQmlImpl::~QQuickWindowQmlImpl() 29 QQuickApplicationWindow::~QQuickApplicationWindow() 30 QQmlPrivate::QQmlElement<QQuickApplicationWindow>::~QQmlElement() 31 QQmlPrivate::QQmlElement<QQuickApplicationWindow>::~QQmlElement() 32 QQmlPrivate::QQmlElement<QQuickApplicationWindow>::~QQmlElement() 33 void qDeleteAll<QList<QObject *>::const_iterator>(QList<QObject *>::const_iterator, QList<QObject *>::const_iterator) 34 void qDeleteAll<QList<QObject *>>(QList<QObject *> const&) 35 QQmlApplicationEnginePrivate::cleanUp() 36 QQmlApplicationEngine::~QQmlApplicationEngine() 37 QQmlApplicationEngine::~QQmlApplicationEngine() 38 main ``` Since we only need this QWindow ptr to open a native menu, there is no reason to even check that list in cases were we're closing a native menu. Thus, it makes sense to completely skip that part when closing. Not only can we skip this step when closing a native menu, but we also don't really need to check qGuiApp->topLevelWindows() in the first place, since the window we're interested in is referenced by the parent item. Using the parent item's window is more semantically correct, since getting an arbitrary top level window from qGuiApp->topLevelWindows() could cause QPlatformMenu::showPopup() to get called with a pointer a completely different window than the intended one. QPlatformMenu::showPopup() and QHighDpi::toNativeLocalPosition() both handle cases where the window argument is nullptr. An autotest would be very welcome, but due to native menus blocking nature, it doesn't seem feasible. Pick-to: 6.10 6.9 6.8 Change-Id: I7f61ed245307a821fdf567e65e3739566505ba73 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* SearchField: Update SortFilterProxyModel in docsDilek Akcay2025-09-271-4/+17
| | | | | | | | | | The documentation snippet used QSortFilterProxyModel, while the Gallery example already demonstrates the QML SortFilterProxyModel. Update the doc to use QML SFPM for consistency. Pick-to: 6.10 Change-Id: I65423d2a36625e5b6a56c734808d8ea735d55b02 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Set explicit default security level of all files with default securityJan Arve Sæther2025-09-17220-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix Popup spacing and insets not supporting bindingsDheerendra Purohit2025-09-041-0/+5
| | | | | | | | | | | Connect spacing and inset change signals from the internal popupItem to the Popup,ensuring that QML bindings and UI updates reflect property changes. Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-135249 Change-Id: Iab92430406e43942c2818a3f62976ccd2fca025d Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Fix uninitialized implicitTextPadding in QQuickMenuPrivateEven Oscar Andersen2025-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by valgrind when running test test_repeater BPASS : tst_controls::Basic::Action::test_repeater() ==433792== Conditional jump or move depends on uninitialised value(s) ==433792== at 0x69C1DE2: double const& qMax<double>(double const&, double const&) (qminmax.h:21) ==433792== by 0x6B13C62: QQuickMenuPrivate::updateTextPadding() (qquickmenu.cpp:1129) ... ==433792== by 0x5999EA8: QtPrivate::QSlotObjectBase::call(QObject*, void**) (qobjectdefs_impl.h:461) ==433792== by 0x5B6411E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:4314) ==433792== by 0x5B58506: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:4374) ==433792== by 0x6F6CA7E: QQuickItem::visibleChanged() (moc_qquickitem.cpp:1031) ==433792== by 0x6F5DE54: QQuickItemPrivate::setEffectiveVisibleRecur(bool) (qquickitem.cpp:6721) ==433792== ==433792== Conditional jump or move depends on uninitialised value(s) ==433792== at 0x6B13CA1: QQuickMenuPrivate::updateTextPadding() (qquickmenu.cpp:1132) ... ==433792== by 0x5999EA8: QtPrivate::QSlotObjectBase::call(QObject*, void**) (qobjectdefs_impl.h:461) ==433792== by 0x5B6411E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:4314) ==433792== by 0x5B58506: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:4374) ==433792== by 0x6F6CA7E: QQuickItem::visibleChanged() (moc_qquickitem.cpp:1031) ==433792== by 0x6F5DE54: QQuickItemPrivate::setEffectiveVisibleRecur(bool) (qquickitem.cpp:6721) ==433792== by 0x6F5DD6E: QQuickItemPrivate::setEffectiveVisibleRecur(bool) (qquickitem.cpp:6711) Pick-to: 6.8 6.9 6.10 Change-Id: I2af1ff26f852a8eb3ce2426f1e8937e889aff1ff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: unparent popupItem when window is set to nullMitch Curtis2025-08-271-0/+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>
* Reset sub-menu and content item during deletion in the quick menuSanthosh Kumar2025-08-253-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The sub-menu item within the menu can have invalid reference when its created and destroyed through loader. The loader uses the incubator to create the items asynchronously (when configured asynchronous), when it becomes active and places them on the object stack. These items are cleared when the loader becomes inactive. In a case where we have the parent menu at the root, the loader places the parent menu at the bottom of the stack, and the sub-menu or any other child item within the menu is placed on top of it during its creation, and the deletion of these items happens from the top, which leads to the paren menu being deleted last. These menu items containing the sub-menu reference have not been reset when the sub-menus are deleted in this way, thus it can lead to a crash as the parent menu refers to an invalid item while resetting its state. The same happens for the contentItem within the menu. This patch ensures that the content item and sub-menu within the menu item are reset during deletion, which avoids the parent menu referring an invalid item. Fixes: QTBUG-137160 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ia9688db90d6a8c8f4e4fa2aadb7e90cb3d8ea25b Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: add a Varying Delegate Sizes sectionMitch Curtis2025-08-193-0/+6
| | | | | | | | | | | | 2436de31bc48b0576d2f48507a89ffbb719e52c1 added documentation for this to ListView, but we also need it in other places so that users don't miss it. Task-number: QTBUG-139026 Pick-to: 6.8 6.9 6.10 Change-Id: I7274bf4524baee4711f370e012009c97a140fd4e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
* Skip reordering content model if items aren't reparented to item viewSanthosh Kumar2025-08-131-9/+31
| | | | | | | | | | | | | | | | | | | | | | | The container reorders the content model items after component completion. The content model can be assigned as a model to the item views to visualise through a container content item. The content item can have item views anywhere in the object hierarchy. If the item views are somewhere down in the line and not at the top, there is a chance during component completion that some of the items are reparented to the item views, and others are with the container content item itself. Thus, reordering at this stage (having partial items) can lead to changing the order of elements within the content model, which further causes repositioning of items within the item views. This patch resolves this issue by skipping reordering the content model, if any of the items are not reparented to the item views. Fixes: QTBUG-138490 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I1673e600774e2821653542c003d2d573f62d024d Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@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>
* Fix qt.qpa.menus warning in tst_qquickmenuMitch Curtis2025-08-083-52/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning was: QWARN: tst_QQuickMenu::FluentWinUI3::nativeStatic() qt.qpa.menus: QPlatformMenuItem(0x60c0001c5040) does not belong to <QCocoaNSMenu: 0x6070000884a0> Title: Supermenu: 0x0 (None), autoenable: YES Previous menu: 0x0 (None) Next menu: 0x0 (None) Items: ( ) In nativeStatic.qml, we have an item tree that looks like this: Menu { Action { /* ... */ } MenuItem { action: Action { /* ... */ } } Menu { Action { /* ... */ } } } Removing the first two menu items of the top-level menu works. When we get to the menu item for subMenu, we see that it has a Menu of its own, and so we call recursivelyDestroyNativeSubMenus. That removes all of the menu's native items, and at the end it does this: menuPrivate->resetNativeData(); Here, menuPrivate refers to subMenu's private object. This line severs the connection between subMenu and menu, which leads to the warning. We then return from recursivelyDestroyNativeSubMenus and end up here in QQuickMenuPrivate::removeNativeItem: if (nativeItem->handle()) { handle->removeMenuItem(nativeItem->handle()); syncWithNativeMenu(); } The removeMenuItem call then triggers the warning. To fix this, we need to have control over when resetNativeData is called, so that we can do it after the removeMenuItem call. Do so by rewriting removeNativeItem to be recursive, and using it in favour of recursivelyDestroyNativeSubMenus, which we then remove. Improve internal docs while we're at it. Pick-to: 6.8 6.9 6.10 Change-Id: I4955a5e4d8e5aa5c9d46873b8b3a27f65446ea35 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Derive QmlTableModel from QAbstractItemModelMatthias Rauter2025-08-061-1/+16
| | | | | | | | | | | | | | | | | | | | | Previously QmlTableModel was derived from QAbstractTableModel. The upsides of QAbstractTableModel are very limited but disable the possibility to combine the similar aspects of QmlTableModel and QmlTreeModel in a common class. In QQuickHeaderView, QAbstractTableModel is treated in a special way. In Order to keep all existing code working, we are treating QmlTableModel the exact same way also after this change. This is the 6th patch in an attempt to make QQmlTreeModel and QQmlTableModel more similar and eventually merge common parts in a common abstract class. Task-number: QTBUG-138703 Pick-to: 6.10 Change-Id: Ifb1f12d147e659320bddccf6c183ac0308cfb99b Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Acknowlege touch event state within the popup as similar to mouseSanthosh Kumar2025-08-051-1/+1
| | | | | | | | | | | | | | | | | The touch events ignored by the pop-up have not been updated with the handled status, and this makes the delivery agent consider the pop-up as the event grabber, which further blocks the touch event from propagating. This patch makes the pop-up to update the event with the touch event handling status. Thus, even the ignored status has been updated in the event, allowing the delivery agent to propagate the events to other items. Fixes: QTBUG-138478 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I2399aea70d58b6d427bf76f871a3fcc04c69a44f Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QQuickPressHandler: c++23 compile fixTim Blechmann2025-08-051-1/+1
| | | | | | | | | | | | When building with c++23, the `= nullptr` assignment to a unique_ptr fully instantiates the underlying type to synthesize the destructor. This means the forward declaration cannot be used. Relying on the default constructor as workaround. Pick-to: 6.8 6.9 6.10 Change-Id: Iff411ae5ea6fe716dc1e2c2c4dbba9e46918fae5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickSearchField: Explicitly add transitive includesFabian Kosmale2025-07-242-0/+2
| | | | | | | Pick-to: 6.10 Change-Id: Icfc4d58347d744de551d842b96a5b7fed21b6f87 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Dilek Akcay <dilek.akcay@qt.io>
* SearchField: Add highlightedIndex and fix ambiguous currentIndex behaviourDilek Akcay2025-07-182-34/+144
| | | | | | | | | | The new highlightedIndex property enables control over the highlighted item in the SearchField. This property follows the same logic and behaviour as the Combobox's highlighted API. Fixes: QTBUG-137862 Pick-to: 6.10 Change-Id: Ifb2a4fd52f126c6ea6b7e36b2b47e4b0f0115428 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>