aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc
blob: 74a54120dbe0d77df220ac29bd1ecb2ed4bf51c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

//! [creating studio components]

    \section1 Creating Custom Controls

    You can use project wizard templates to create stylable UI controls based
    on the components in the Qt Quick Controls module:

    \table
    \row
        \li \l Button
        \li \l {Check Box}
        \li \l {Slider and Dial}{Dial}
    \row
        \li \inlineimage studio-custom-button.gif
        \li \inlineimage studio-custom-check-box.gif
        \li \inlineimage studio-custom-dial.gif
    \row
        \li \l {Slider and Dial}{Slider}
        \li \l {Spin Box}
        \li \l Switch
    \row
        \li \inlineimage studio-custom-slider.gif
        \li \inlineimage studio-custom-spinbox.gif
        \li \inlineimage studio-custom-switch.gif
    \endtable

    You can edit the properties of the controls in all the preset
    \l{Adding States}{states} to apply your own style to them.

    \note For buttons and check boxes, you can disable the misbehaving hover
    effects by selecting \l Properties > \uicontrol Control, and then disabling
    the \uicontrol Hover check box.

    \image studio-dial.png "A stylable Dial component in Form Editor"

    To create stylable UI controls:

    \list 1
        \li Select \uicontrol File > \uicontrol {New File} >
            \uicontrol {Files and Classes} > \uicontrol {Qt Quick Controls}.
        \li Select the control to create, and then select \uicontrol Choose.

            \note Components are listed in \l Components >
            \uicontrol {My Components} only if the filename begins with a
            capital letter.
        \li Edit component properties in the \l Properties view.

            The available properties depend on the component type. You can
            \l{Specifying Dynamic Properties}{add properties for components} in
            \l {Connection View} > \uicontrol Properties.
    \endlist

    For an example of using the \uicontrol Button template to create a button
    and styling it, see \l{Creating a Push Button} in the \l{Log In UI - Components}
    tutorial.

    In addition, you can create starting points for different types of screens:

    \list
        \li \l [QtQuickControls2] {Pane}
        \li \l {Stack Layout}
        \li \l [QtQuickControls2] {SwipeView}{Swipe View}
    \endlist

//! [creating studio components]
*/