Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtlabsstylekit-index.qdoc
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page qtlabsstylekit-index.html
6 \title Qt Labs StyleKit
7 \brief A high-level styling API for Qt Quick Controls
8
9 StyleKit is a declarative styling system for \l {Qt Quick Controls}, built on top of
10 \l {Qt Quick Templates 2}{Qt Quick Templates}. It lets you define a complete visual style
11 for all your controls from a single \l Style object, including support for
12 \l {Theme}{themes}, \l {ControlStateStyle}{state-based} styling, and
13 \l {ControlStateStyle::transition}{transitions}.
14 StyleKit handles the underlying template implementation automatically, letting you focus
15 purely on visual aspects such as
16 \l {DelegateStyle::color}{colors},
17 \l {DelegateStyle::implicitWidth}{dimensions},
18 \l {DelegateStyle::border}{borders}, and
19 \l {DelegateStyle::shadow}{shadows}.
20
21 A key strength of StyleKit is its hierarchical property system: set a property once
22 on a base type like \l {AbstractStylableControls::}{abstractButton}, and it
23 automatically applies to all button-like controls.
24 Override it where needed for specific controls or states. Changes to your
25 style are instantly reflected across all controls, ensuring consistency while still
26 allowing fine-grained customization.
27
28 For controls that need custom behavior beyond what StyleKit provides, you can still
29 implement custom templates and integrate them seamlessly alongside StyleKit-styled
30 controls.
31
32 \section1 Key Features
33
34 \list
35 \li \b{Declarative Styling} - An easy-to-use QML API that lets you focus on design over implementation
36 \li \b{Hierarchical Fallbacks} - All properties propagate. Set them once, override where needed
37 \li \b{State-Based Styling} - Design separate appearances for hovered, pressed, focused, etc.
38 \li \b{Animated Transitions} - Define smooth animations between states
39 \li \b{Theme Support} - Design light and dark themes, and any number of custom themes
40 \li \b{Variations} - Design multiple variations of the same controls
41 \li \b{Palette and Font Integration} - Configure control palettes and fonts using QML
42 \endlist
43
44 The following example shows a minimal example of a Style:
45
46 \snippet PlainStyle.qml 1
47
48 This is how to set the style in your application:
49
50 \snippet PlainStyleMain.qml 1
51
52 \section1 Using the Module in your Project
53 The QML types of the module are available through the \c QtQuick.labs.StyleKit import.
54 To use the types, add the following import statement to your .qml file:
55
56 \qml
57 import Qt.labs.StyleKit
58 \endqml
59
60 \section1 Articles and Guides
61
62 \section1 Examples
63 \list
64 \li \l{StyleKit Example} - Shows how to style \l {Qt Quick Controls} using \l {Qt Labs StyleKit}{StyleKit}.
65 \endlist
66
67 \section1 QML Types
68
69 \generatelist {qmltypesbymodule Qt.labs.StyleKit}
70
71 \section1 Licenses
72
73 Qt Labs StyleKit is available under commercial licenses from \l{The Qt Company}.
74 In addition, it is available under the
75 \l{GNU Lesser General Public License, version 3}, or
76 the \l{GNU General Public License, version 2}.
77 See \l{Qt Licensing} for further details.
78*/