aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/impl
Commit message (Collapse)AuthorAgeFilesLines
* Context menus: rename control to editorMitch Curtis2025-11-121-6/+6
| | | | | | | | | | | | | | This better reflects what it is and avoids naming conflicts with the controls themselves. Pick down to 6.9 (where QQuickContextMenu was introduced) to avoid future cherry-pick conflicts. Task-number: QTBUG-133556 Task-number: QTBUG-134903 Pick-to: 6.9 6.10 Change-Id: If0af26c5f16ee56cc909fcc66d1421109786343e Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Change PopupType of textEditingContextMenu for Popup.Item on WaylandFrederic Lefebvre2025-10-311-1/+1
| | | | | | | | | | | | | | | | Use Popup.Item popupType when test is run on Wayland. Remove the need for a transient parent on Wayland that was causing several tests of tst_QQuickTextField to consistently fail. Fix the following failing tests on Ubuntu 24.04 wayland tst_QQuickTextField::contextMenuCopy, contextMenuCut, contextMenuDelete, contextMenuPaste, contextMenySelectAll, releaseAfterPressAndHold, touchscreenDoesNotSelect. Pick-to: 6.10 Change-Id: I5a411dae63ae36361ed83055a1eb4c87de17acae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* quickcontrols - material style: postpone updating qsgnodesInho Lee2025-10-131-23/+63
| | | | | | | | | | | | | | QQuickAnimatedNode uses beforeRendering and this connection can conflict with Quick3D render prep. Updating qsgnodes will be delayed for now to prevent the crash. Fixes: QTBUG-126193 Pick-to: 6.10 6.8 Change-Id: I29aa09fb6a52a4446818699bebf42eabf613c43f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Material: don't set individual radii properties on rectangle SG nodeMitch Curtis2025-10-011-8/+0
| | | | | | | | | | As of 727d2350391512cb8449f9db781b4e1041a8068c this isn't necessary and turns our lovely circle into a square. Fixes: QTBUG-136958 Pick-to: 6.10 Change-Id: I96d3d8e3e2061a3a2b387bf8e35a9bcc9fd3e9ed Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Set explicit default security level of all files with default securityJan Arve Sæther2025-09-1720-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Material Container: fix includesFabian Kosmale2025-08-201-1/+2
| | | | | | | | | | | Add the missing QPointer include and switch to the preferred include style. Amends 21ff1d42c0563b5369f5dca78417adb3d9008787 Pick-to: 6.10 Change-Id: I8f39b82333128043d44a7e46821553e1f3709d41 Reviewed-by: Morteza Jamshidi <morteza.jamshidi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material Style: fix focusIn and focusOut animation issuesMorteza Jamshidi2025-08-144-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.10 6.9 6.8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* 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.9 6.8 Change-Id: I11dc288463c0966821fe09f7f9fe85be1aa2c56b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix mixed-type usage of qFuzzyCompareDennis Oberst2025-03-141-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.9 6.8 6.5 Change-Id: Iee8154e3296a281f8efaac276b9a4d66a20d420b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: Fix FloatingPlaceholderText X positionBartlomiej Moskal2025-02-282-0/+59
| | | | | | | | | | | | | | | | | | | 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.9 6.8 Change-Id: I5c80dcedd7c2beec0891b524fc55388fa5456f2a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ContextMenu: add to text editing controlsMitch Curtis2025-02-282-0/+32
| | | | | | | | | | | [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 Pick-to: 6.9 Change-Id: I0897a7ba5e1b5b6d5425c80cbc6f2550c904605b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickMaterialTextContainer: don't explicitly create a brushVolker Hilsheimer2024-12-181-1/+1
| | | | | | | | | Rely on the implicit construction, and allow for an optimized QPainter::drawBrush(QColor) to not create a brush at all. Pick-to: 6.9 6.8 Change-Id: I9a18c72f85afb1383ce9f2056830f02330cf2897 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix BusyIndicator being hidden when running is changed quicklyMitch Curtis2024-10-022-3/+12
| | | | | | | | | | | | | | | | If running is set to false and then true within a short period, BusyIndicatorImpl's OpacityAnimator cancels the 1 => 0 animation (which was for running being set to false), setting opacity to 0 and hence visible to false. This happens _after_ setRunning(true) was called, because the properties were set synchronously but the animation is asynchronous. To account for this situation, we only hide ourselves if we're not running by storing and checking our running state. Fixes: QTBUG-85860 Pick-to: 6.5 6.7 6.8 Change-Id: I220dfb78f00028e4a12a92fc14082006e1844002 Reviewed-by: Doris Verria <doris.verria@qt.io>
* Controls: Avoid visual glitches in Material styleEirik Aavitsland2024-08-201-0/+1
| | | | | | | | | | | The ElevationEffect renders into a layer. However, as the layer sampling was not specified as smooth, there was a risk that visual glitches could be produced when the layer was rendered onto the scene. Fixes: QTBUG-115759 Pick-to: 6.8 Change-Id: Id793fd224434b9b6e946ed4e31eba79e9f92db8e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Controls: replace Qt.styleHints with Application.styleHintsMitch Curtis2024-06-211-1/+1
| | | | | | | | | | | | | | As mentioned in QTBUG-95540, using the latter provides better type information for tooling, and avoids the "this property only exists on the object if Quick has been imported" issue. Replace QtQml import in Fluent style's Config.qml with QtQuick to provide access to the Application type. Fixes: QTBUG-126512 Pick-to: 6.5 6.7 6.8 Change-Id: I4aac22e54f3b522f74acafd467ce22139352c9dd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Materials.impl: Mark dependency on Controls.implFabian Kosmale2024-03-271-0/+1
| | | | | | | | | | | | | QQuickMaterialPlaceholderText derives from QQuickPlaceholderText, so there is a dependency to Controls.impl on the C++ level. Make that one explicit, so that QDS can resolve the type in its code model. Fixes: QTBUG-123594 Pick-to: 6.5 6.7 Change-Id: I890f683af65daf501f93b4224897568ef269837d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Material: animate RadioButton indicatorMitch Curtis2024-03-071-4/+27
| | | | | | | | | | | This makes it match the specs: https://m3.material.io/components/radio-button/guidelines#eba97636-1dd9-4e81-a1a6-20b8123d1b83 Fixes: QTBUG-113532 Pick-to: 6.5 6.6 6.7 Change-Id: I266a8f8c6ace780650b26f72fa1bd7ea8c933507 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material: fix assertion failure when quickly changing TextField's focusMitch Curtis2024-02-151-1/+12
| | | | | | | | | | | | Focus changes can happen before the focus in/out animations finish. In that case, stop the animation, which will eventually delete it. Until it's deleted, we clear the pointer so that our asserts don't fail for the wrong reason. Fixes: QTBUG-118889 Pick-to: 6.6 6.7 Change-Id: I6398805c006dadac71e168126c7a387357d5d2b0 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QuickControls: Link the impl libraries into the base modulesUlf Hermann2024-02-021-2/+1
| | | | | | | | | | | | | | | This forces the build system to build them before, making the qmltypes files available to the base modules' build steps. The linker might even actually link the libraries and avoid the excessivle plugin loading that way. To encourage that, also drop the pointless NO_PLUGIN_OPTIONAL. Pick-to: 6.7 6.6 Task-number: QTBUG-121643 Change-Id: Ifd9082a5927deac8c9d67edf4104338ddaa35aa5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove all QML_DECLARE_TYPE from src and toolsUlf Hermann2023-11-183-6/+0
| | | | | | | | They are generally not useful for anything. Change-Id: I12e959ce9338e6eb7465633496c7921fa09a3fe8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Material: respect horizontalAlignment in placeholder textHatem ElKharashy2023-11-114-19/+71
| | | | | | | | | | | | | This allows placeholder text to follow the Alignment set to the TextField or TextArea components when using Material style. The placeholder text will float to the left, right, or center depending on the alignment set, and the arc will be drawn properly in case of Material.Outline container style. Fixes: QTBUG-118856 Pick-to: 6.6 6.5 Change-Id: Ic9cede806dc2f6109e7e2c4b2b2fc960d9c6a1b6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Include what you need: <QPointer>Marc Mutz2023-10-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I9b98cda524a0e6a61be7805edda708916bb2bc2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Material: allow setting background to nullMitch Curtis2023-09-191-3/+0
| | | | | | | | | | | | The texteditor example does this since it's a full-screen editor. Currently that example produces a warning. It also doesn't cost us much to support it. Amends 2d99c70f982da92c70c022551cf456877141a5c8. Pick-to: 6.5 6.6 Change-Id: I8fb847297add3ab10f4ee5e6b5634ac841bfd4e6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material: fix regression in rippleMitch Curtis2023-09-081-0/+8
| | | | | | | | | After ca20f7e82f21dd06ce0d04fd937e915e2805e51e, we have to set the individual radius properties of QSGInternalRectangleNode to -1 (as QQuickRectangle does) to ensure that the radius is correct. Change-Id: I395a2c1eee3491ed8c5acbcf286932d5d2203d74 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material: make Switch respect Dense variantMitch Curtis2023-08-141-5/+5
| | | | | | | | | | This patch makes the Material 3 Switch more compact when the Dense variant is in use, bringing it in line with other controls like Button. Fixes: QTBUG-116028 Pick-to: 6.5 6.6 Change-Id: I8df7a5d00688965066ea40eee8d6a9a918d2265f Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QQuickMaterialPlaceholderText: fix code checker complaintMitch Curtis2023-05-171-1/+1
| | | | | | | | | | | | | | The message was: result of integer division used in a floating point context; possible loss of precision Fixing it revealed a test that relied on it; removed the Math.floor() work-around the test used previously. Pick-to: 6.5 Change-Id: I7c2fde1902d2013ba9fedcadf87ae3b21987fca2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Material: fix clipped floating placeholder textMitch Curtis2023-05-091-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes to placeholder text in 20e3d1b522d1b79239e9ac4a6af47ce3648512bd and 5704741a4073ac131782c3dd73cac5cda6800a28 result in floating placeholder text (i.e. the text shown at the top of the control when it has active focus) being clipped when e.g. in a ScrollView. This is probably only an issue for TextArea in practice, since you wouldn't usually put a TextField in a ScrollView, but you can still run into it if you clip it. We don't want to unconditionally set topInset by default, because, as mentioned above, these controls are not always clipped. In most cases they are used on their own, and this issue won't affect them. Unconditionally setting topInset would ruin the layout of existing UIs. So, we set topInset only if the control itself clips (or its Flickable parent in the case of TextArea). [ChangeLog][Controls][Material] The outlined TextArea now sets topInset by default if it or its Flickable parent clips. This avoids the floating placeholder being clipped in those cases. The outlined TextField sets topInset by default only if the TextField itself clips. Fixes: QTBUG-113321 Pick-to: 6.5 Change-Id: I8555e4fc0c7a9800f76b54a84d94f4d04691bc23 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Material: fix placeholder text alignmentMitch Curtis2023-05-031-1/+3
| | | | | | | | | | The placeholder text should always be aligned to the left according to my tests on native Android via an emulator. Fixes: QTBUG-113172 Pick-to: 6.5 6.5.1 Change-Id: I75ae31e1e6b9846d90ab5034c43f8684698e0ab7 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material: fix TextArea decorations when in a FlickableMitch Curtis2023-04-193-5/+24
| | | | | | | | | | | | | | | | This patch fixes the following issues when the Material TextArea is attached to a Flickable: - Floating placeholder text scrolls with the Flickable. - When text is cleared without the control having focus: - Floating placeholder text is positioned incorrectly. - The floating text background outline gap is still open. - The background outline color is incorrect when the control has focus (used primaryTextColor instead of accentColor). Pick-to: 6.5 Task-number: QTBUG-112650 Change-Id: Icfa3517e4abcb1209ea2291dabdec225011f19ef Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Revert value label for the Qt Quick Controls Material sliderOliver Eftevaag2023-03-201-44/+0
| | | | | | | | | | | | | | | | The SliderHandle was changed in 0ac8eb67eaa2fca2881caaf439dcac68716f4634 to display the current value of the slider, while the SliderHandle was being pressed. This feature should be optional, and we currently don't have a nice API for hiding it. Let's look for a way to introduce this feature in Qt 6.6 instead. Task-number: QTBUG-111355 Pick-to: 6.5 6.5.0 Change-Id: I3c3f240839d1b69c0fea32d59c8abc8e64e1a184 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Controls: condition shaders at build timeLaszlo Agocs2023-03-081-1/+1
| | | | | | | | | | | The machinery inherited from Qt 5, with file selectors and whatnot, is simply not needed anymore. Pick-to: 6.5 Change-Id: If0728a4fa057335fe8471899da50b836f8d56d35 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: fix placeholder text y position when control is too smallMitch Curtis2023-03-082-12/+52
| | | | | | | | | Ensure that it's sensibly positioned despite its size. Fixes: QTBUG-111515 Pick-to: 6.5 6.5.0 Change-Id: I71816c461ff1d2f85e010bf871ab1b7ef2ccaf6e Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Update Material TextField to Material 3Mitch Curtis2023-02-175-0/+836
| | | | | | | | Fixes: QTBUG-72554 Fixes: QTBUG-109218 Pick-to: 6.5 Change-Id: I0bc6fc3d16630352dcd5c58c5dd2b1bf794741c5 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Update Material Slider and RangeSlider to Material 3Oliver Eftevaag2023-02-101-10/+49
| | | | | | | | | | | | | | | | | | | | | | | | | The following visual changes are made to the sliders: - Add label showing the current slider value when the handle is being pressed. - Add tick marks when the slider is "discrete". Meaning when stepSize is a non-zero value that is divisible by the difference between to and from, snapMode is SnapAlways and the number of tick marks that would be rendered is less than the width to height ratio, or vice versa for vertical sliders. In order to position the tick marks correctly, the background size had to be adjusted. The size of the handle will now be subtracted from the background size. - The handle grow animation when being pressed has been removed, but the "halo" effect remains unchanged. Done-with: Matthias Rauter <matthias.rauter@qt.io> Fixes: QTBUG-108229 Pick-to: 6.5 Change-Id: Ifdfe488845cc06a1b5454262ad670658de30fb90 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQuickControls: Disambiguate static constantsFriedemann Kleint2023-02-071-2/+2
| | | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I6e7fbb1d3f33eda50f55257b6df5aaf47170eb57 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQuick: Fix warnings about fields anonymous namespacesFriedemann Kleint2023-02-031-3/+1
| | | | | | | | | | | | | Remove anonymous namespaces, fixing warnings like: qsgareaallocator.cpp:27:8: warning: QSGAreaAllocatorNode has a field QSGAreaAllocatorNode::splitType whose type uses the anonymous namespace [-Wsubobject-linkage] which occur in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I71e4ec5f89bbf4220efd9a8ba819ee5fb39b95e8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update Material Switch to Material 3Mitch Curtis2022-12-121-20/+72
| | | | | | Fixes: QTBUG-108555 Change-Id: I6c17812c9cf0dab71ac212ab7cb28cad646f9dfc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/material3Paul Wicking2022-12-055-116/+169
| | | | Change-Id: I55ec34220c5b9001893fc924ab6be7fd64e63a02
* Remove "2" from Qt Quick Controls directoriesMitch Curtis2022-12-0115-0/+1819
Qt Quick Controls 2 was named that way because it was a follow-up to Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer supported, we don't need to have "2" in the name. Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. By doing this renaming a few weeks before feature freeze, it won't affect the release but still results in as little time possible spent manually fixing conflicts in cherry-picks from non-LTS releases as a result of the renaming. This patch does the following: - Renames directories. - Adapts CMakeLists.txt and other files to account for the new paths. A follow-up patch will handle documentation. It does not touch library names or other user-facing stuff, as that will have to be done in Qt 7. Task-number: QTBUG-95413 Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>