aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols
Commit message (Collapse)AuthorAgeFilesLines
* Fusion: give TextArea a backgroundMitch Curtis2025-09-114-26/+42
| | | | | | | | | | | | | | | This is the same background as TextField. This will cause the implicitWidth for TextArea to be the same as TextField - i.e. a bit wider - whereas before it was only as wide as the text + padding. This fixes it not being visible, especially without placeholder text. Fixes: QTBUG-139715 Change-Id: Ia736c2e282497f0a40bf8726adcc2838082ea5b4 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 006c4eedda9c42b4f47a0b9c5c11277dc341369b) (cherry picked from commit 4bfe26268019f209f8c97b01361ac87fcd2aacf6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* mac style: fall back to draw ProgressBar manually on macOS Tahoe 26Richard Moe Gustavsen2025-09-101-3/+89
| | | | | | | | | | | | | | | | | | | | | On macOS Tahoe 26, the drawing of a ProgressBar using the mac style is broken. Nothing is drawn if we continue to use [NSView drawRect:], [NSView bitmapImageRepForCachingDisplayInRect:] or [CALayer renderInContext:] (and similar API) for drawing an NSProgressIndicator. This patch will therefore implement a fall back approach where we draw the ProgressBar manually when we detect that the current version of macOS is running with liquid glass support. Pick-to: 6.8 6.5 Task-number: QTBUG-138947 Task-number: QTBUG-138942 Change-Id: I26faea6e24d48bf0cb7bf2cd2b114d6ca2c2825f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 14bf8bac0dd6277710ada42a491a2af619fbb30d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e7b763373350e01c3a45823a6c8b682ee939fbe0)
* Quick theme (iOS): include UITraitCollection headerTimur Pocheptsov2025-08-271-0/+1
| | | | | | | | | | | Include it explicitly, not relying on implicit inclusion (which gave me a compilation error about incomplete forward-declared-only class). Change-Id: Ie569d00da2a26e72e556d830ecb8ba1b4a13ffb5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 4ab1e09c0e86f02b8e9a6aaffbad732620bbb7ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 33bd103874647673138acb661587b97f06c85ac2)
* Doc: add a Varying Delegate Sizes sectionMitch Curtis2025-08-201-0/+8
| | | | | | | | | | | | | | | 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 Change-Id: I7274bf4524baee4711f370e012009c97a140fd4e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Matthias Rauter <matthias.rauter@qt.io> (cherry picked from commit 554f0371e56be1ecede0eef32bc78f41d8facce0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 78a1438132f562b843b38334117530618984aba2)
* Material Style: fix focusIn and focusOut animation issuesMorteza Jamshidi2025-08-204-104/+86
| | | | | | | | | | | | | | | When a property potentially used in focusIn or focusOut animation is changed, we need to reschedule the animation with the correct parameters. properties like verticalPadding, leftPadding, controlHasText, ... To fix the issue I simplified focus animation logic. Fixes: QTBUG-138028 Change-Id: I115fb6fdd5676ae0282b5b4b5bd460ea3b28392a Pick-to: 6.8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 21ff1d42c0563b5369f5dca78417adb3d9008787) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a91d76f17f4982736bf165e8873cc63f7f554c31)
* Spinbox example: Make the first * non greedyAlbert Astals Cid2025-08-081-4/+5
| | | | | | | | | | | | | Otherwise it will consume the - as part of it, and we want to keep the - for negative numbers. For it to work we have to add the $ at the end Pick-to: 6.8 Change-Id: Ibe4750ccd4d36fef604ae424fea34ee9d64432cd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 884c7ac633a35db95c3b7b552431bc34322dfdf5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b5f469132c61b7efd17fe2090703d0675b15aaa6)
* Remove link to deprecated MS documentationBenedikte Holm2025-08-013-3/+3
| | | | | | | | | | | The documentation on the MS site does not exist anymore. Pick-to: 6.8 Change-Id: Id8093840ac84c0b8d77305dd7b9db28067c3c575 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0e67794e730abdf6a9513631510e1f2e4c930bb9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 1d81e65dc0bddd3b8a4df8f7fa0749f543b27973)
* Material Toolbar: Reflect background color with set custom primary colorSanthosh Kumar2025-07-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the quick material style, the primary color or any other colors within its color system would be considered as custom if the set color is outside the predefined enum colors or provided in other color formats. These colors within the material color system can be set by the user through options such as conf or env. The material toolbar, by default, initialises the background color with the primary color. Thus, it's expected implicitly that the background color should reflect the primary color as set by the user. It's also to be noted that this does not necessarily mean to consider background color as custom (as it hasn't been explicitly overridden by the user). This assumption of custom background color has been corrected as part of patch 76d7080fbefc33988d8517f1a964ebdb5c3b3dd2. The controls (such as Toolbar), when requesting the background color, validate whether it has been explicitly set or not. If set, the same shall be provided; otherwise, it can be colors from the predefined range or the default color. In this case, the background color would not be considered as explicitly set (reflecting the primary color), and thus it falls back to the default color as it's also not within the predefined range in the material style. But it's valid to expect the primary color as set by the user. This patch resolves this issue by having additional validation with the primary color properties when providing the background color. Fixes: QTBUG-138602 Change-Id: I1ef1d1b4cd59ec191d6b3cf2886640c52193248e Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> (cherry picked from commit d542f1a60f7617a3b9a465c18e08c5850d38407e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 6420f64787d40c7bac55d072e758104889915e79)
* QQuickAttachedPropertyPropagator: fix incorrect logging outputMitch Curtis2025-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The output below is from running tst_qquickmaterialstyle::Material::test_inheritance_popup(accent). Before: initialize called for Popup_QMLTYPE_42(0x1df863e3ce0) - looking for attached parent... findAttachedParent called with QQuickMaterialStyle Popup_QMLTYPE_42(0x1df863e3ce0) - attachee does not belong to a popup - attachee is a popup; checking its window After: initialize called for Popup_QMLTYPE_45(0x1e4003fb460) - looking for attached parent... findAttachedParent called with QQuickMaterialStyle Popup_QMLTYPE_45(0x1e4003fb460) - attachee is not a popup item - attachee is a popup; checking its window Pick-to: 6.8 6.5 Change-Id: I5d0af24f918efd1cd10ea28715ea1c1badb0736d Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit d6f478999ebbad33b7446389cce9ff57195f8c77) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit dda70ffad40a48b140fab8b348308cb1d1cdeb6d)
* FluentWinUI3 style: Don't set imlicitWidth for combobox content itemDoris Verria2025-07-241-2/+0
| | | | | | | | | | | | | | | | | | | | We were setting the implicitWidth of the combobox's inner text field to depend on the width of the content (ie: text). However, for an editable combobox this means that the textField will expand horizontally as you type to accomodate for the new typed text. This is not wanted behavior. To fix, don't manually set the implicitWidth to the content item, as a text field already has its own implicit size. Note that "implicitResize", which controls whether the textfield recalculates its implicit size when its content changes, is set to false by default for a text field. Pick-to: 6.8 Change-Id: I2f7ca2706dc2957fd600a0c06dc28010bfb4f7c6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit d136963fd6c121c7904717ce6e3ab6d9d5011c7e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 4658437dd307ce7c3c3b46e7f4d98b13c0591b51)
* FluentWinUI3: Resolve palette against platform theme and app's palette when ↵Doris Verria2025-07-223-25/+35
| | | | | | | | | | | | | | | | | | | | updating When we were updating the theme as a result of the color scheme change, we were just updating the palette to the default colors, forgetting to resolve against the theme palette and the guiApp palette. This was different from the palette initialization logic, which resolves against both platform and app palette, making the style palette inconsistent between the initial palette and the updated one after the color scheme change. To fix, use the same logic when both initializing and updating the palette. Also, refactor some code and function names. Pick-to: 6.8 Change-Id: I80a0983509323002e8d422b79c5271c312d8d963 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit da96a15dfd0e29537d32c367ed066f8bff52958d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit de5a78c1cf9f2a025788a8c9cd8b47d78bda69b6)
* iOS Style: Resolve UIColor-s with appropriate trait collectionDoris Verria2025-07-101-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | QQuickIOSSTheme::intialize() is called when first setting up the theme (and its palette) for the iOS style, as well as whenever the color scheme gets updated. This is a function that is called on the QML thread by the style plugin, as the QQuickTheme also lives in the QML thread. In this function we resolve the palette colors through the dynamic UIColor-s, which update based on the currentTraitCollection. However, it is not safe to rely on the value of the currentTraitCollection property outside the main thread, or even in functions other than the documented methods where UIKit sets the property as it may be invalid. To fix, construct a trait collection based on the current color scheme and resolve the UIColor against it. Fixes: QTBUG-138200 Pick-to: 6.8 Change-Id: I404428844bc2e3b35be5746746d8d21bde3b3832 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 4eee74ecf71b1ed3c1b37683790c46fbe0d73ac3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 50e0ecc8af8095f115ab763fc4a4634f353fb193)
* Doc: add a section about mixing style selection methodsMitch Curtis2025-06-231-4/+46
| | | | | | | | | | | | | | | | | We don't want to encourage this, but as mentioned in the change itself: in the case of applications that load third party QML code, it may not be possible to control which imports are used. So, this change documents the limitations to be aware of when mixing the two. Task-number: QTBUG-117526 Task-number: QTBUG-136709 Pick-to: 6.8 6.5 Change-Id: I5601266758f123998d3ae5d03892fba42c6c5b8f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit a6548a92512cfc976ef828d220a9429c62e6cc36) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a013e338670bb927efd1904d0fdd81e792df86b1)
* Allow SelectionRectangle dragging if TableView doesn't flick via mouseShawn Rutledge2025-06-231-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Task-number: QTBUG-97111 Task-number: QTBUG-132268 Change-Id: I912dbc7bf8de536794b5bdcc1269bf2860645de9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 472eb06f70730ee61e47e852ab352539697fa881) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 764c5e030abc5aa5dbcd00f11de6c90a5ba6393c)
* CMake: Add PURL and CPE info to 3rd party attribution filesAlexandru Croitor2025-06-061-0/+1
| | | | | | | | | | | | | | [ChangeLog][Third-Party Code] Added PURL and CPE information to the attribution files of 3rd party sources. Pick-to: 6.8 6.5 Fixes: QTBUG-137262 Task-number: QTBUG-129602 Change-Id: I1a5691ff042c47461fe4769399c3bd2d6ec52160 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 92dceea85ef77c0dddef28917c543902e0f85478) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit b226d8793769d07b1eec6937d700eceddd276a24)
* Documentation: close \styleproperty properlyThibaut Cuvelier2025-06-051-0/+2
| | | | | | | | | | | | | By design, \styleproperty should be closed with \endstyleproperty. This was not the case for one subsection. While mostly harmless in HTML, this cause the DocBook export to be invalid. Pick-to: 6.8 6.5 Change-Id: Ie4172535ffb9183e9105bf7e9b407d834459486c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit ddb45c3cb6ffca606d4c0933b4135e7a0ac300c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ae00c761f6c9deb6d2b95e53ff3ab2b663f62733)
* Doc: Fix Linking issuesTopi Reinio2025-05-261-0/+5
| | | | | | | | | | | | | | | | - 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() Change-Id: I3bab7155f8d73af6d51f8cfe890ece6d31671f1d Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> (cherry picked from commit 50d8d6cfa0f3370f0af4d8d5fc168d3dfe12e83e)
* Material: Fix ToolBar color updates on theme changesJarkko Koivikko2025-05-222-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes two issues in the ToolBar: 1. Background color The ToolBar background was not using the correct shade rule for the Dark theme (it did not switch to Shade200). 2. Foreground color With certain theme changes, the ToolBar could end up with black text when white text was expected (according to toolTextColor rules). Although the changes are relatively straightforward, the root cause is nuanced due to the interplay of theme defaults and custom overrides. Here is what the patch does: - Marks globalForegroundCustom and globalBackgroundCustom as false by default so that built-in defaults are treated as theme-based rather than custom. - Emits foreground and background change notifications on theme changes, except when the color is a true custom color (which remains unchanged). - Resets background and foreground colors to style defaults if the property is set to a default theme color and there’s no global override. - Removes direct assignment of Material.foreground in the ToolBar, replacing it with a dynamic approach. If the ToolBar background is set to primary, it automatically applies toolTextColor as its foreground. Change-Id: I10cc7aa5276de712ed76f7acf7b56d6541bce70e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 76d7080fbefc33988d8517f1a964ebdb5c3b3dd2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Remove transparent backgrounds from calendar imagesKai Köhne2025-05-2212-0/+0
| | | | | | | | | | | | | 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. Change-Id: I9b0cd1cb479145c17f37533ade8b09564d2f5534 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit 6c0b74ccc9b90f42fb9bca06681bdcb9ea7440fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Remove transparent backgrounds from wireframe imagesKai Köhne2025-05-2115-9/+9
| | | | | | | | | These don't work well in dark mode. Also, convert to webp while at it. Change-Id: Ie210c7cc03f742f2cfbd5af3d3b692309ccf6aae Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit e7134fe5773eca1f482ba8ec5a52c816789c4e33) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "ContextMenu: add to text editing controls"Mitch Curtis2025-05-1966-672/+0
| | | | | | | | | This reverts commit dfcde3ea4d8a81d511cce5fb5eccdbb47e92d2c7. Reason for revert: introduces a regression: QTBUG-134903 Change-Id: I4ac4c2949635e6f67ae706052083c699cd61c144 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Revert "Close all other Menus when showing non-sub-menu"Mitch Curtis2025-05-192-64/+14
| | | | | | | | | | | | This reverts commit 4fc898246aa96922a28d5206c79ad00dc040d930. Reason for revert: dfcde3ea4d8a81d511cce5fb5eccdbb47e92d2c7, which this requires, causes a regression: QTBUG-134903. The documentation part of this patch that doesn't rely on the content added in dfcde3e will be re-introduced in a separate patch. Change-Id: Idb4d74fd963f6c0759b8a05b686f1a977d97013c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Remove mentioning of Qt Quick Calendar moduleKai Köhne2025-05-141-5/+5
| | | | | | | | | | | | This seems to be a left-over from the 'Qt Quick Calendar' extension that is not supported anymore since Qt 6.3 (?). While at it, rewrite the whole paragraph for brevity. Change-Id: Id1bef92d2e745fc4cbf761555d8aba0271edfc10 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 711b4d7a383a79d8b73ced106f82228e664fd8ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use platform theme's palette in macOS styleTor Arne Vestbø2025-04-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike most other styles the macOS style didn't initialize QQuickTheme with a style specific palette (either directly or via a custom theme class). Instead, we would indirectly pick up the platform theme palette when QQuickStylePlugin::createTheme called QQuickStylePrivate::readPalette to read palette settings, as we then default-constructed a QPalette, which picks up its colors from QGuiApplicationPrivate::app_pal, which in turn is based on platform theme palette, via QGuiApp's basePalette. However QQuickStylePlugin::createTheme only initialized the System palette of QQuickTheme, which meant that we failed to use any role specific palettes that the platform theme provided. In addition, because we only initialized the palette once, when creating the theme, we failed to pick up any changes to the platform theme's palette. To fix this we simply tell the QQuickTheme to prefer the platform theme for its palette, which means any query to the theme will go through the platform theme. This also means we don't need to hook into QtQuickControls2StylePlugin::updateTheme() to re-initialize the palette. Technically we do have the same problem with the theme's fonts, but for that we don't have a way to instruct the theme to use the platform theme. Pick-to: 6.8 6.5 Change-Id: I56eb278a80b184397114282839e958d61bd0028e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 457958b4cd68ed38a40cc8e6732f0032496a7bac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Docs: Update contentItem info in qtquickcontrols-customizeZhang Hongyuan2025-04-161-29/+28
| | | | | | | | | | | Change the "content item" field to match the contentItem attribute of the Control Type Fixes: QTBUG-135956 Pick-to: 6.8 Change-Id: I493c02fbd1670344dda462e44b8fb98b1f13fab3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit e3ee4cd5141d0d4ffb4129ca807cad831a4974d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: improve "Context Menus" section of Menu's documentationMitch Curtis2025-04-151-5/+1
| | | | | | | | | | | | - Simplify code snippet. - Simplify note about desktop platforms. Task-number: QTBUG-134903 Change-Id: Ibc0db63fd3f0692c42d0b2e6685d4437850cb5a8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d1457b0d788d3bfde48011553061b387067df204) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickMaterialPlaceholderText: Add MEMBER to Q_PROPERTY declarationsBartlomiej Moskal2025-04-101-2/+2
| | | | | | | | | | | | | | | | | | | In e70994631407b16738d2c2be8c956d8d3bbf5499 commit, two new Q_PROPERTY declarations were added: leftPadding and floatingLeftPadding. Both were missing the MEMBER keyword, which allows the Qt meta-object system to access the member variables directly. Without this fix, the following compilation warning appears: "Property declaration leftPadding has neither an associated QProperty<> member, nor a READ accessor function nor an associated MEMBER variable. The property will be invalid." Task-number: QTBUG-133492 Pick-to: 6.8 Change-Id: I11dc288463c0966821fe09f7f9fe85be1aa2c56b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit a12dcbc8d5488641868ca5e867044f3fe3d099ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Code snippet shows a function reference from inside ComponentAlexei Cazacov2025-04-101-5/+5
| | | | | | | | | | | | | This commit fixes a code snippet, that called a function from inside Component, which led to "ReferenceError: formatText is not defined" error. Fixes: QTBUG-135437 Pick-to: 6.8 Change-Id: Ic72e04feb74df7fd35315a2542a3178eb4356f00 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 914d164773d0b37dc1fb4cbda60792a1f873b2a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Close all other Menus when showing non-sub-menuMitch Curtis2025-04-092-14/+68
| | | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: I158295b72176935c2dc8072a72a4df66678be824 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9ac0e70cdbf99e06761b6edb28937fded8791bdb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_Snippets: fail on warningsMitch Curtis2025-03-241-1/+5
| | | | | | | | | Task-number: QTBUG-98718 Pick-to: 6.8 Change-Id: I24e641952ca4570f85928c53fb9752a595d50122 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> (cherry picked from commit 7aea117ffacc2c1fab8b3267b883f92af8b5efcd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: move Menu's detailed description snippets into snippet filesMitch Curtis2025-03-244-0/+94
| | | | | | | | | | | | 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 Change-Id: Ib773dd2780e8ffe0a554852bd20ef20a4ab65c1a Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> (cherry picked from commit 3615d319e4ee1c1165f6d24867d4f27207941005) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* FluentWinUI3 Style: Hide private QML propertiesDoris Verria2025-03-2030-377/+378
| | | | | | | | | | | The style declares several QML dynamic properties which are meant to be private. Hide them using __ convention. Pick-to: 6.8 Change-Id: I4317d2ee7072a72fda1736fc8c9165a980889d95 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 669a61a9d0c5f578bc594f832863c1ad7f1e537e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS Style: Hide private propertiesDoris Verria2025-03-204-41/+46
| | | | | | | | | | | The style declares many dynamic properties that are meant to be private and not available eg: from code completion. Use __ to hide them. Pick-to: 6.8 Change-Id: Idf132a71cacad6ddff951bc378101f1d094112f5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit e26b0ab97b0c02dbe9d32c496a54835c64bc2b3b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Menu: adjust the insets according to the drop shadowRichard Moe Gustavsen2025-03-202-8/+17
| | | | | | | | | | | | | | | | | | | | | As it stood, the background delegate of a Menu would draw its drop shadow on the outside of the delegate, and therefore also on the outside of the Menu as a whole. This works fine for Popup.Item, since an Item is allowed to draw out-of-bounds. But for Popup.Window, this would fail. Instead, the correct solution in this case is to draw the shadow _inside_ the delegate, and instead make the whole menu bigger by adjusting the insets instead, to take the shadow into account. In order to be able to do this, we also need to teach StyleImage to optionally draw the shadow inside the bounds. Pick-to: 6.8 Change-Id: I306e511abca44f4f86ee18a16740f679cf987ac1 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 39f6b9fb2a0b434e14a820a74de244163964659a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix ambiguous qBound usage when qreal is floatDennis Oberst2025-03-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | When building Qt with a non-double qreal type, i.e. QT_COORD_TYPE=float, explicit template specialization like: qBound<qreal>(0.0, qreal(0.5), 1.0); is ambiguous because the double literals conflict with qreal (float). This creates ambiguity when resolving between overloads such as: qBound<T>(const T&, const T&, const T&) qBound<T, U>(const T&, const U&, const T&) Fix this by porting to std::clamp(), which ensures consistent types and avoids the implicit conversions that made such ambiguities possible. Pick-to: 6.8 6.5 Change-Id: I45b430dd26a90fd0289111f1b336d40533c74841 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e4c899716568386d12344f2398c3412765f58d02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix mixed-type usage of qFuzzyCompareDennis Oberst2025-03-171-1/+1
| | | | | | | | | | | | | | | | | | When building Qt with a non-double qreal type, i.e. QT_COORD_TYPE=float, mixing types on qFuzzyCompare will result in ambiguities since the two overloads: qFuzzyCompare(float, float) qFuzzyCompare(double, double) will compete with eachother. Fix this by ensuring that both arguments passed to the function have the same type. Pick-to: 6.8 6.5 Change-Id: Iee8154e3296a281f8efaac276b9a4d66a20d420b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 8a2f3b0666da3f03c77156f640b619cfb90195d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mark quickcontrols2 fusion style as a requirement for macos styleJuha Vuolle2025-03-141-1/+1
| | | | | | | | | | | | | | | | | Configure fails if feature-quickcontrols2-macos is enabled but feature-quickcontrols2-fusion is not. This is because qtdeclarative/src/quickcontrols/macos/CMakeLists.txt references the fusion style unconditionally. This commit marks fusion style as a requirement, which in turn requires the basic style (original requirement). Fixes: QTBUG-134725 Pick-to: 6.8 Change-Id: I5dd1647c5daef82d21fc0f03aa204523cc6086e4 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit dc212815277612cec5e2802ee6527d8e369abc1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS Style: Dial: Adjust handle positioning and refactor codeDoris Verria2025-03-071-26/+29
| | | | | | | | | | | | | | | | | - Don't explicitly set background positioning as this is automatically handled by the control to account for control insets. - Adjust radius of handle transform to be the same as the radius of the path angle arc - Protect in case of null handle or background - Simplify and refactor code Fixes: QTBUG-134001 Fixes: QTBUG-129424 Pick-to: 6.8 6.5 Change-Id: Ie54d2fd76e85e8c59e96110f4bc8b9e45623cea2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 90f97dfb223bdeb81a07373fa80f4863c4836056) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Material: Fix FloatingPlaceholderText X positionBartlomiej Moskal2025-02-284-4/+63
| | | | | | | | | | | | | | | | | | | | | In cb7eb152204e206539f307a9556eea43c589f026, we stopped using the leftPadding value for FloatingPlaceholderText. As a result, the text is now misaligned with the placeholder. This commit restores the FloatingPlaceholderText X position to leftPadding. If leftPadding is not set, it defaults to Material.textFieldHorizontalPadding. To prevent regressions (such as QTBUG-120149), a new X position animation has been added to FloatingPlaceholderText. Fixes: QTBUG-133492 Pick-to: 6.8 Change-Id: I5c80dcedd7c2beec0891b524fc55388fa5456f2a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit e70994631407b16738d2c2be8c956d8d3bbf5499) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Avoid leaking Private dependencies for style pluginsAlexandru Croitor2025-02-285-10/+10
| | | | | | | | | | | | | | | | | Use qt_internal_extend_target instead of target_link_libraries for the Qt Quick style plugins. This wraps their private module dependencies in BUILD_INTERFACE genexes. It avoids leaking the deps to consumers of the style plugins in a static build, where the private modules are not in scope by default. Pick-to: 6.8 Change-Id: Iac4b9d97c112fa829a60170d7fdad60f97e43f1f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 5bef75090f1e1315819ecfb88419e965b357898a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ContextMenu: add to text editing controlsMitch Curtis2025-02-2866-0/+672
| | | | | | | | | | | | [ChangeLog][Controls] TextField and TextArea now provide a ContextMenu by default. If you already have a custom context menu for these types, ContextMenu will not open its own on e.g. right click. Fixes: QTBUG-35598 Change-Id: I0897a7ba5e1b5b6d5425c80cbc6f2550c904605b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 3b598b6f7509f57e198e7de1f04e4333555e7227) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change background color of the Windows style MenuBarOliver Eftevaag2025-02-271-1/+1
| | | | | | | | | | | | | | | | | | The background color was hard coded to be white, which prevented it from adapting to dark mode and high contrast theme changes. Use button background color instead, since native windows applications appears to use the same color for both button and menubar backgrounds. It's also the color role we're assigning to in menubarPalette() in qwindowstheme.cpp Task-number: QTBUG-133595 Pick-to: 6.8 Change-Id: Ic9fdaebb2b38c125b223a5599396d93463ac9cd1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 67844ae00bff9995e5cc968dfa8532db23fe68d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make module ready for source SBOM checkingLucie Gérard2025-02-222-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: - turning VERIFY_SOURCE_SBOM ON - adding rules to the licenseRule.json files - correcting the licensing given via REUSE.toml files - renaming license files not located in LICENSES folder. Their name needs to be prefixed with `LICENSE.` to be ignored by reuse and excluded from the source SBOM. The names are updated in the corresponding qt_attribution.json A lot of files are skipped during the license test, but all are present in the source SBOM. This is why corrections are needed before turning the source SBOM check on. [ChangeLog][Third-Party Code] Renaming the license files with prefix LICENSE. to have them ignored by reuse tool. Task-number: QTBUG-131434 Pick-to: 6.8 Change-Id: I2b3e4750405f13a97b350ee65def30f1330526a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 361f1f38e0396e38168819907eba4ad72bbd2b5f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Overlay: ignore right button clicksMitch Curtis2025-02-211-0/+2
| | | | | | | | | | | | | | So that ContextMenu can open when e.g. a Drawer is in the scene. [ChangeLog][Important Behavior Changes][Controls][Overlay] The pressed and released signals are no longer emitted for right clicks. This is to allow ContextMenu to work when controls like Drawer are used. Fixes: QTBUG-132765 Change-Id: If329a2ddaaf76e498e7ae2cd48a899fc23dba6b9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit fdb1db77a51e22857bda87dd0c6a783ea71d26f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mark TableViewDelegate as introduced in 6.9Fabian Kosmale2025-02-211-0/+4
| | | | | | | | Change-Id: I39312a020939f4de5b80e9a0bf4b39294e9fa7f5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io> (cherry picked from commit 8daf02d39c7d29461fed9d281c9dae0f2e34ae04) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickContextMenuForeign: fix QML_ADDED_IN_VERSION macroMitch Curtis2025-02-201-1/+1
| | | | | | | | | | | It should be 6.9, not 6.8. Amends 0794a0e06e40703b191ea3af5ddbb14fafafea8e. Change-Id: Ibdeaca9196c36a12668237feda487aab78e88fbd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 5c308edb3a5551ab1e013a052de709a36e04f948) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Docs: Add more snippets for QQuickAttachedPropertyPropagatorAlexei Cazacov2025-02-041-8/+39
| | | | | | | | | Task-number: QTBUG-130156 Pick-to: 6.8 Change-Id: If6d365b6b0819cc018a01427f468cfa2b2a3eeea Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 3cf7f87f0629a3bb8489376a58132829dd5b647b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ContextMenu: defer creation of Menu until it's shownMitch Curtis2025-02-041-0/+17
| | | | | | | | | | | This enables adding a Cut/Copy/Paste context menu to our text editing controls without a Menu being created at startup for each control. Fixes: QTBUG-132265 Change-Id: I2fbbce457208cfeb0df8f043746615b7c52f65e0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5a987204a6213d703eaba349d2785d0281406905) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Docs: Update the published QML code to reflect current best practicesAlexei Cazacov2025-01-271-1/+1
| | | | | | | | | | | This commit addresses the edit proposals mentioned in the QTBUG-131978. Task-number: QTBUG-131978 Pick-to: 6.8 Change-Id: Ib94379c6dc0778f5aee8e53c5f1015ad7b10779f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 44beb8080c44c1956d15c1df5de984614612fd68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: add more ContextMenu documentationMitch Curtis2025-01-182-0/+97
| | | | | | | | Fixes: QTBUG-132553 Change-Id: I305908d25022b091cba94c7753f69ac9030ae9fd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 18725f625ab919ba18240c14443a268d40e383bd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>