aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2022-11-21 17:51:53 +0800
committerMitch Curtis <mitch.curtis@qt.io>2022-12-05 15:00:35 +0800
commite592a2ad31695695f0dd2069b17c6ab90ed1a739 (patch)
tree7e3410ae3cec5ade5c5dc3c6c7d4db3c73509156 /src/quick/doc/snippets
parent20fd2902a6d7bdb4a3306005d2718ca5a8fef96d (diff)
Warn users when they customize native styles
Since Qt 6, the default style is no longer the Basic style, but instead depends on the platform the application is run on. In addition, the introduction of the native styles (which are not designed to be customized) means that users customizing controls can run into visual issues and not understand why. This patch partially addresses this issue by warning when a native control is customized (i.e. a delegate is overridden): "qrc:/main.qml:11:22: QML QQuickItem: The current style does not support customization of this control (property: "contentItem" item: QQuickItem(0x1637375d210, parent=0x0, geometry=0,0 0x0)). Please customize a non-native style (such as Basic, Fusion, Material, etc). For more information, see: https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#customization-reference" Ideally we'd also have qmllint integration in Creator so that users get warnings from the IDE as they code, but that's not there yet. The patch also updates the documentation by removing the code snippet from the note and referring users to the existing "Using Styles in Qt Quick Controls" section, which covers the topic in greater detail. The snippet itself is also not considered a part of the note, so the (online) styling looked a bit off. [ChangeLog][Important Behavior Changes] Customization of native styles will now result in warnings. Non-native styles (such as Basic) should be used for customization purposes, or a custom style. If you are aware of the risks and still want to customize these controls, you can ignore the warnings by setting QT_QUICK_CONTROLS_IGNORE_CUSTOMIZATION_WARNINGS to 1. Fixes: QTBUG-108519 Task-number: QTBUG-96733 Change-Id: Ib6dff4639bad76b228e0f31285d20db4e3207224 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/doc/snippets')
0 files changed, 0 insertions, 0 deletions