aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/stylekit/styles
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2025-11-27 17:53:53 +0100
committerDoris Verria <doris.verria@qt.io>2025-12-01 13:03:28 +0100
commitcaeaa6bdd10d1d5b2bcd3b59f629583905197267 (patch)
treea06bea62a507686de54f428168b858f1509bdb77 /examples/quickcontrols/stylekit/styles
parent49f14263cd587282f77b0fac761de74483e52485 (diff)
StyleKit: Add style and theme fontsHEADdev
Add a fonts property to the style that allows you to set fonts per control, similarily to what we do in QQuickTheme. The fonts are propagated from the style to the theme, and from the fallback style to the style. That means that if a font is not set for a theme or style, it will be resolved against its fallback font. Since both the QQStyleKitTheme and QQStyleKitStyle should have a fonts property, introduce a common base class: QQStyleKitThemeProperties that contains the fonts property. Later, the palettes can be moved there as well. Also add a font property to the QQStyleKitReader that is suposed to return the font for the current control being read. Change-Id: I116c1ab9bc426570756476ee409513587c475a0d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples/quickcontrols/stylekit/styles')
-rw-r--r--examples/quickcontrols/stylekit/styles/Haze.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/quickcontrols/stylekit/styles/Haze.qml b/examples/quickcontrols/stylekit/styles/Haze.qml
index b3920f7c59..db58af43ad 100644
--- a/examples/quickcontrols/stylekit/styles/Haze.qml
+++ b/examples/quickcontrols/stylekit/styles/Haze.qml
@@ -7,6 +7,16 @@ import Qt.labs.StyleKit
Style {
id: style
+ fonts {
+ systemFont {
+ family: "Courier New"
+ pointSize: 12
+ }
+ textFieldFont {
+ bold: true
+ }
+ }
+
control {
// 'control' is the fallback for all the controls. Any properties that are not
// overridden by a specific control underneath will be read from here instead.