aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc
blob: aeb92918d632fe3121cb704dc0e1b661dfccb157 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Design Studio documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

//! [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]
*/